Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Changed
-------

- Renamed the ``globus_sdk._testing`` subpackage to ``globus_sdk.testing``. (:pr:`1251`)
24 changes: 12 additions & 12 deletions docs/testing/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
This component is an *alpha*. Interfaces may change outside of the
normal semver policy.

Getting Started with _testing
=============================
Getting Started with testing
============================

Dependencies
------------

This toolchain requires the ``responses`` library.

``globus_sdk._testing`` is tested to operate with the latest version of
``globus_sdk.testing`` is tested to operate with the latest version of
``responses``.

Recommended Fixtures
Expand Down Expand Up @@ -41,7 +41,7 @@ activated by name:

.. code-block:: python

from globus_sdk._testing import load_response
from globus_sdk.testing import load_response

# load_response will add the response to `responses` and return it
load_response("auth.get_identities")
Expand All @@ -54,7 +54,7 @@ unbound, as in:
.. code-block:: python

import globus_sdk
from globus_sdk._testing import load_response
from globus_sdk.testing import load_response

load_response(globus_sdk.AuthClient.get_identities)
load_response(globus_sdk.AuthClient.get_identities, case="unauthorized")
Expand All @@ -71,7 +71,7 @@ load all of them at once:

.. code-block:: python

from globus_sdk._testing import load_response_set
from globus_sdk.testing import load_response_set

fixtures = load_response_set("scenario.foo")

Expand All @@ -86,7 +86,7 @@ response is ``"default"``.
.. code-block:: python

from globus_sdk import AuthClient
from globus_sdk._testing import get_response_set
from globus_sdk.testing import get_response_set

# rset will not be activated
rset = get_response_set(AuthClient.get_identities)
Expand All @@ -110,7 +110,7 @@ override the builtin response sets, if names match.

.. code-block:: python

from globus_sdk._testing import load_response_set, register_response_set
from globus_sdk.testing import load_response_set, register_response_set
import uuid

# register a scenario under which Globus Auth get_identities and Globus
Expand Down Expand Up @@ -152,7 +152,7 @@ Loading Responses without Registering

Because ``RegisteredResponse`` takes care of resolving ``"auth"`` to the Auth
URL, ``"transfer"`` to the Transfer URL, and so forth, you might want to use
``globus_sdk._testing`` in lieu of ``responses`` even when registering single
``globus_sdk.testing`` in lieu of ``responses`` even when registering single
responses for individual tests.

To support this mode of usage, ``load_response`` can take a
Expand All @@ -165,7 +165,7 @@ Consider the following example of a parametrized test which uses

.. code-block:: python

from globus_sdk._testing import load_response, RegisteredResponse
from globus_sdk.testing import load_response, RegisteredResponse
import pytest


Expand All @@ -191,7 +191,7 @@ outside of the specific test.
Using non-default responses.RequestsMock objects
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

By default, all methods in ``globus_sdk._testing`` which converse with
By default, all methods in ``globus_sdk.testing`` which converse with
``responses`` use the default mock. This is the behavior offered by
``responses.add(...)`` and similar methods.

Expand All @@ -208,7 +208,7 @@ e.g.

.. code-block:: python

from globus_sdk._testing import get_last_request
from globus_sdk.testing import get_last_request
import responses

custom_mock = responses.RequestsMock(...)
Expand Down
8 changes: 4 additions & 4 deletions docs/testing/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
This component is an *alpha*. Interfaces may change outside of the
normal semver policy.

.. _testing_root:
.. testing_root:

Globus SDK _testing
===================
Globus SDK testing
==================

.. warning::

The exact data and payloads provided via ``_testing`` are a best
The exact data and payloads provided via ``testing`` are a best
approximation of API responses. They may change in any SDK release to be
more accurate.

Expand Down
4 changes: 2 additions & 2 deletions docs/testing/methods/auth.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Globus Auth _testing Method List
================================
Globus Auth testing Method List
===============================

.. enumeratetestingfixtures:: globus_sdk.AuthClient
4 changes: 2 additions & 2 deletions docs/testing/methods/flows.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Globus Flows _testing Method List
=================================
Globus Flows testing Method List
================================

.. enumeratetestingfixtures:: globus_sdk.FlowsClient

Expand Down
4 changes: 2 additions & 2 deletions docs/testing/methods/gcs.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Globus Connect Server _testing Method List
==========================================
Globus Connect Server testing Method List
=========================================

.. enumeratetestingfixtures:: globus_sdk.GCSClient
4 changes: 2 additions & 2 deletions docs/testing/methods/groups.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Globus Groups _testing Method List
==================================
Globus Groups testing Method List
=================================

.. enumeratetestingfixtures:: globus_sdk.GroupsClient
6 changes: 3 additions & 3 deletions docs/testing/methods/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
This component is an *alpha*. Interfaces may change outside of the
normal semver policy.

_testing Method List
====================
testing Method List
===================

These pages list all methods which have ``globus_sdk._testing`` response data,
These pages list all methods which have ``globus_sdk.testing`` response data,
and the casenames for those data.

.. toctree::
Expand Down
4 changes: 2 additions & 2 deletions docs/testing/methods/search.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Globus Search _testing Method List
==================================
Globus Search testing Method List
=================================

.. enumeratetestingfixtures:: globus_sdk.SearchClient
4 changes: 2 additions & 2 deletions docs/testing/methods/timers.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Globus Timers _testing Method List
==================================
Globus Timers testing Method List
=================================

.. enumeratetestingfixtures:: globus_sdk.TimersClient
4 changes: 2 additions & 2 deletions docs/testing/methods/transfer.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Globus Transfer _testing Method List
====================================
Globus Transfer testing Method List
===================================

.. enumeratetestingfixtures:: globus_sdk.TransferClient
6 changes: 3 additions & 3 deletions docs/testing/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
This component is an *alpha*. Interfaces may change outside of the
normal semver policy.

_testing Reference
==================
testing Reference
=================

.. module:: globus_sdk._testing
.. module:: globus_sdk.testing

Functions
---------
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ typing = [
"types-requests",
"typing-extensions>=4.0",
# although 'responses' is provided by the test requirements, it also
# must be installed for proper type-checking on globus_sdk._testing
# must be installed for proper type-checking on globus_sdk.testing
"responses",
# similarly, sphinx is needed to type-check our sphinx extension
"sphinx",
Expand Down Expand Up @@ -120,7 +120,7 @@ source = ["globus_sdk"]
# omit must be specified in a way which matches the
# tox environment installations, so lead with `**`
omit = [
"**/globus_sdk/_testing/*",
"**/globus_sdk/testing/*",
]

[tool.coverage.paths]
Expand Down
2 changes: 1 addition & 1 deletion scripts/ensure_exports_are_documented.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"globus_sdk/globus_app/",
"globus_sdk/scopes/",
"globus_sdk/response.py",
"globus_sdk/_testing/",
"globus_sdk/testing/",
)

DEPRECATED_NAMES = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class EnumerateTestingFixtures(AddContentDirective):
}

def gen_rst(self) -> t.Iterator[str]:
from globus_sdk._testing import get_response_set
from globus_sdk.testing import get_response_set

underline_char = self.options.get("header_underline_char", "-")

Expand Down Expand Up @@ -46,7 +46,7 @@ def gen_rst(self) -> t.Iterator[str]:
for casename in rset.cases():
# use "attr" rather than "meth" so that sphinx does not add parens
# the use of the method as an attribute of the class or instance better
# matches how `_testing` handles things
# matches how `testing` handles things
yield (
".. dropdown:: "
f':py:attr:`~{classname}.{methodname}` (``case="{casename}"``)'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from docutils.parsers.rst import directives

from globus_sdk._testing import ResponseList
from globus_sdk.testing import ResponseList

from .add_content_directive import AddContentDirective

Expand All @@ -17,7 +17,7 @@ class ExpandTestingFixture(AddContentDirective):
}

def gen_rst(self) -> t.Iterator[str]:
from globus_sdk._testing import get_response_set
from globus_sdk.testing import get_response_set

response_set_name = self.arguments[0]
casename = "default"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from responses.matchers import json_params_matcher

from globus_sdk._testing.models import RegisteredResponse, ResponseSet
from globus_sdk.testing.models import RegisteredResponse, ResponseSet

_COMMON_RESPONSE_RECORD = {
"fqdns": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from responses.matchers import json_params_matcher

from globus_sdk._testing.models import RegisteredResponse, ResponseSet
from globus_sdk.testing.models import RegisteredResponse, ResponseSet

_COMMON_RESPONSE_RECORD = {
"fqdns": [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import uuid

from globus_sdk._testing.models import RegisteredResponse, ResponseSet
from globus_sdk.testing.models import RegisteredResponse, ResponseSet

NEW_CREDENTIAL_NAME = str(uuid.uuid4()).replace("-", "")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from responses.matchers import json_params_matcher

from globus_sdk._testing.models import RegisteredResponse, ResponseSet
from globus_sdk.testing.models import RegisteredResponse, ResponseSet

APP_REQUEST_ARGS = {
"template_id": str(uuid.uuid1()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from responses.matchers import json_params_matcher

from globus_sdk._testing.models import RegisteredResponse, ResponseSet
from globus_sdk.testing.models import RegisteredResponse, ResponseSet

POLICY_REQUEST_ARGS = {
"project_id": str(uuid.uuid1()),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import uuid

from globus_sdk._testing.models import RegisteredResponse, ResponseSet
from globus_sdk.testing.models import RegisteredResponse, ResponseSet

project_id = str(uuid.uuid1())
star_lord = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from responses.matchers import json_params_matcher

from globus_sdk import DependentScopeSpec
from globus_sdk._testing.models import RegisteredResponse, ResponseSet
from globus_sdk.testing.models import RegisteredResponse, ResponseSet

SCOPE_REQUEST_ARGS = {
"client_id": str(uuid.uuid1()),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import uuid

from globus_sdk._testing.models import RegisteredResponse, ResponseSet
from globus_sdk.testing.models import RegisteredResponse, ResponseSet

CLIENT = {
"required_idp": None,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import uuid

from globus_sdk._testing.models import RegisteredResponse, ResponseSet
from globus_sdk.testing.models import RegisteredResponse, ResponseSet

CREDENTIAL = {
"name": "foo",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import uuid

from globus_sdk._testing.models import RegisteredResponse, ResponseSet
from globus_sdk.testing.models import RegisteredResponse, ResponseSet

POLICY = {
"high_assurance": False,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import uuid

from globus_sdk._testing.models import RegisteredResponse, ResponseSet
from globus_sdk.testing.models import RegisteredResponse, ResponseSet

project_id = str(uuid.uuid1())
star_lord = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import uuid

from globus_sdk._testing.models import RegisteredResponse, ResponseSet
from globus_sdk.testing.models import RegisteredResponse, ResponseSet

SCOPE = {
"scope_string": "https://auth.globus.org/scopes/3f33d83f-ec0a-4190-887d-0622e7c4ee9a/manager", # noqa: E501
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import uuid

from globus_sdk._testing.models import RegisteredResponse, ResponseSet
from globus_sdk.testing.models import RegisteredResponse, ResponseSet

FQDN = "globus.org"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import uuid

from globus_sdk._testing.models import RegisteredResponse, ResponseSet
from globus_sdk.testing.models import RegisteredResponse, ResponseSet

CREDENTIAL = {
"name": "foo",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import uuid

from globus_sdk._testing.models import RegisteredResponse, ResponseSet
from globus_sdk.testing.models import RegisteredResponse, ResponseSet

FOO_CLIENT = {
"required_idp": None,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from globus_sdk._testing.models import RegisteredResponse, ResponseSet
from globus_sdk.testing.models import RegisteredResponse, ResponseSet

_DATA_ACCESS = (
"https://auth.globus.org/scopes/542a86fc-1766-450d-841f-065488a2ec01/data_access"
Expand Down
Loading