summaryrefslogtreecommitdiff
path: root/tests/oauth2
diff options
context:
space:
mode:
Diffstat (limited to 'tests/oauth2')
-rw-r--r--tests/oauth2/rfc6749/clients/test_backend_application.py3
-rw-r--r--tests/oauth2/rfc6749/clients/test_base.py2
-rw-r--r--tests/oauth2/rfc6749/clients/test_legacy_application.py6
-rw-r--r--tests/oauth2/rfc6749/clients/test_mobile_application.py3
-rw-r--r--tests/oauth2/rfc6749/clients/test_service_application.py4
-rw-r--r--tests/oauth2/rfc6749/clients/test_web_application.py13
-rw-r--r--tests/oauth2/rfc6749/endpoints/test_base_endpoint.py12
-rw-r--r--tests/oauth2/rfc6749/endpoints/test_client_authentication.py11
-rw-r--r--tests/oauth2/rfc6749/endpoints/test_credentials_preservation.py9
-rw-r--r--tests/oauth2/rfc6749/endpoints/test_error_responses.py11
-rw-r--r--tests/oauth2/rfc6749/endpoints/test_extra_credentials.py9
-rw-r--r--tests/oauth2/rfc6749/endpoints/test_introspect_endpoint.py5
-rw-r--r--tests/oauth2/rfc6749/endpoints/test_metadata.py6
-rw-r--r--tests/oauth2/rfc6749/endpoints/test_resource_owner_association.py11
-rw-r--r--tests/oauth2/rfc6749/endpoints/test_revocation_endpoint.py3
-rw-r--r--tests/oauth2/rfc6749/endpoints/test_scope_handling.py11
-rw-r--r--tests/oauth2/rfc6749/grant_types/test_authorization_code.py8
-rw-r--r--tests/oauth2/rfc6749/grant_types/test_client_credentials.py3
-rw-r--r--tests/oauth2/rfc6749/grant_types/test_implicit.py2
-rw-r--r--tests/oauth2/rfc6749/grant_types/test_refresh_token.py3
-rw-r--r--tests/oauth2/rfc6749/grant_types/test_resource_owner_password.py8
-rw-r--r--tests/oauth2/rfc6749/test_parameters.py2
-rw-r--r--tests/oauth2/rfc6749/test_request_validator.py2
-rw-r--r--tests/oauth2/rfc6749/test_server.py15
-rw-r--r--tests/oauth2/rfc6749/test_tokens.py9
-rw-r--r--tests/oauth2/rfc6749/test_utils.py9
26 files changed, 88 insertions, 92 deletions
diff --git a/tests/oauth2/rfc6749/clients/test_backend_application.py b/tests/oauth2/rfc6749/clients/test_backend_application.py
index b05786a..c1489ac 100644
--- a/tests/oauth2/rfc6749/clients/test_backend_application.py
+++ b/tests/oauth2/rfc6749/clients/test_backend_application.py
@@ -1,12 +1,11 @@
# -*- coding: utf-8 -*-
import os
-
from unittest.mock import patch
from oauthlib import signals
from oauthlib.oauth2 import BackendApplicationClient
-from ....unittest import TestCase
+from tests.unittest import TestCase
@patch('time.time', new=lambda: 1000)
diff --git a/tests/oauth2/rfc6749/clients/test_base.py b/tests/oauth2/rfc6749/clients/test_base.py
index c545c25..c77cfed 100644
--- a/tests/oauth2/rfc6749/clients/test_base.py
+++ b/tests/oauth2/rfc6749/clients/test_base.py
@@ -6,7 +6,7 @@ from oauthlib.oauth2 import Client, InsecureTransportError, TokenExpiredError
from oauthlib.oauth2.rfc6749 import utils
from oauthlib.oauth2.rfc6749.clients import AUTH_HEADER, BODY, URI_QUERY
-from ....unittest import TestCase
+from tests.unittest import TestCase
class ClientTest(TestCase):
diff --git a/tests/oauth2/rfc6749/clients/test_legacy_application.py b/tests/oauth2/rfc6749/clients/test_legacy_application.py
index 1daf2a3..b5a1819 100644
--- a/tests/oauth2/rfc6749/clients/test_legacy_application.py
+++ b/tests/oauth2/rfc6749/clients/test_legacy_application.py
@@ -1,14 +1,12 @@
# -*- coding: utf-8 -*-
import os
-
+import urllib.parse as urlparse
from unittest.mock import patch
from oauthlib import signals
from oauthlib.oauth2 import LegacyApplicationClient
-import urllib.parse as urlparse
-
-from ....unittest import TestCase
+from tests.unittest import TestCase
@patch('time.time', new=lambda: 1000)
diff --git a/tests/oauth2/rfc6749/clients/test_mobile_application.py b/tests/oauth2/rfc6749/clients/test_mobile_application.py
index 2fb839e..c40950c 100644
--- a/tests/oauth2/rfc6749/clients/test_mobile_application.py
+++ b/tests/oauth2/rfc6749/clients/test_mobile_application.py
@@ -1,12 +1,11 @@
# -*- coding: utf-8 -*-
import os
-
from unittest.mock import patch
from oauthlib import signals
from oauthlib.oauth2 import MobileApplicationClient
-from ....unittest import TestCase
+from tests.unittest import TestCase
@patch('time.time', new=lambda: 1000)
diff --git a/tests/oauth2/rfc6749/clients/test_service_application.py b/tests/oauth2/rfc6749/clients/test_service_application.py
index 6f48e23..b97d855 100644
--- a/tests/oauth2/rfc6749/clients/test_service_application.py
+++ b/tests/oauth2/rfc6749/clients/test_service_application.py
@@ -1,14 +1,14 @@
# -*- coding: utf-8 -*-
import os
from time import time
+from unittest.mock import patch
import jwt
-from unittest.mock import patch
from oauthlib.common import Request
from oauthlib.oauth2 import ServiceApplicationClient
-from ....unittest import TestCase
+from tests.unittest import TestCase
class ServiceApplicationClientTest(TestCase):
diff --git a/tests/oauth2/rfc6749/clients/test_web_application.py b/tests/oauth2/rfc6749/clients/test_web_application.py
index 719a07d..1f711f4 100644
--- a/tests/oauth2/rfc6749/clients/test_web_application.py
+++ b/tests/oauth2/rfc6749/clients/test_web_application.py
@@ -1,19 +1,18 @@
# -*- coding: utf-8 -*-
import os
+import urllib.parse as urlparse
import warnings
-
from unittest.mock import patch
from oauthlib import common, signals
-from oauthlib.oauth2 import (BackendApplicationClient, Client,
- LegacyApplicationClient, MobileApplicationClient,
- WebApplicationClient)
+from oauthlib.oauth2 import (
+ BackendApplicationClient, Client, LegacyApplicationClient,
+ MobileApplicationClient, WebApplicationClient,
+)
from oauthlib.oauth2.rfc6749 import errors, utils
from oauthlib.oauth2.rfc6749.clients import AUTH_HEADER, BODY, URI_QUERY
-import urllib.parse as urlparse
-
-from ....unittest import TestCase
+from tests.unittest import TestCase
@patch('time.time', new=lambda: 1000)
diff --git a/tests/oauth2/rfc6749/endpoints/test_base_endpoint.py b/tests/oauth2/rfc6749/endpoints/test_base_endpoint.py
index 2289b58..b1af6c3 100644
--- a/tests/oauth2/rfc6749/endpoints/test_base_endpoint.py
+++ b/tests/oauth2/rfc6749/endpoints/test_base_endpoint.py
@@ -1,10 +1,12 @@
# -*- coding: utf-8 -*-
-from oauthlib.oauth2 import (FatalClientError, OAuth2Error, RequestValidator,
- Server)
-from oauthlib.oauth2.rfc6749 import (BaseEndpoint,
- catch_errors_and_unavailability)
+from oauthlib.oauth2 import (
+ FatalClientError, OAuth2Error, RequestValidator, Server,
+)
+from oauthlib.oauth2.rfc6749 import (
+ BaseEndpoint, catch_errors_and_unavailability,
+)
-from ....unittest import TestCase
+from tests.unittest import TestCase
class BaseEndpointTest(TestCase):
diff --git a/tests/oauth2/rfc6749/endpoints/test_client_authentication.py b/tests/oauth2/rfc6749/endpoints/test_client_authentication.py
index 69cb7ee..0659ee0 100644
--- a/tests/oauth2/rfc6749/endpoints/test_client_authentication.py
+++ b/tests/oauth2/rfc6749/endpoints/test_client_authentication.py
@@ -10,14 +10,15 @@ on the request object with a client_id parameter. The client_id attribute
prevents this check from being circumvented with a client form parameter.
"""
import json
-
from unittest import mock
-from oauthlib.oauth2 import (BackendApplicationServer, LegacyApplicationServer,
- MobileApplicationServer, RequestValidator,
- WebApplicationServer)
+from oauthlib.oauth2 import (
+ BackendApplicationServer, LegacyApplicationServer, MobileApplicationServer,
+ RequestValidator, WebApplicationServer,
+)
+
+from tests.unittest import TestCase
-from ....unittest import TestCase
from .test_utils import get_fragment_credentials
diff --git a/tests/oauth2/rfc6749/endpoints/test_credentials_preservation.py b/tests/oauth2/rfc6749/endpoints/test_credentials_preservation.py
index 9a76da9..32c770c 100644
--- a/tests/oauth2/rfc6749/endpoints/test_credentials_preservation.py
+++ b/tests/oauth2/rfc6749/endpoints/test_credentials_preservation.py
@@ -4,14 +4,15 @@ The Authorization Code Grant will need to preserve state as well as redirect
uri and the Implicit Grant will need to preserve state.
"""
import json
-
from unittest import mock
-from oauthlib.oauth2 import (MobileApplicationServer, RequestValidator,
- WebApplicationServer)
+from oauthlib.oauth2 import (
+ MobileApplicationServer, RequestValidator, WebApplicationServer,
+)
from oauthlib.oauth2.rfc6749 import errors
-from ....unittest import TestCase
+from tests.unittest import TestCase
+
from .test_utils import get_fragment_credentials, get_query_credentials
diff --git a/tests/oauth2/rfc6749/endpoints/test_error_responses.py b/tests/oauth2/rfc6749/endpoints/test_error_responses.py
index aac66df..3f53c71 100644
--- a/tests/oauth2/rfc6749/endpoints/test_error_responses.py
+++ b/tests/oauth2/rfc6749/endpoints/test_error_responses.py
@@ -1,15 +1,16 @@
"""Ensure the correct error responses are returned for all defined error types.
"""
import json
-
from unittest import mock
from oauthlib.common import urlencode
-from oauthlib.oauth2 import (BackendApplicationServer, LegacyApplicationServer,
- MobileApplicationServer, RequestValidator,
- WebApplicationServer)
+from oauthlib.oauth2 import (
+ BackendApplicationServer, LegacyApplicationServer, MobileApplicationServer,
+ RequestValidator, WebApplicationServer,
+)
from oauthlib.oauth2.rfc6749 import errors
-from ....unittest import TestCase
+
+from tests.unittest import TestCase
class ErrorResponseTest(TestCase):
diff --git a/tests/oauth2/rfc6749/endpoints/test_extra_credentials.py b/tests/oauth2/rfc6749/endpoints/test_extra_credentials.py
index 936a129..97aaf86 100644
--- a/tests/oauth2/rfc6749/endpoints/test_extra_credentials.py
+++ b/tests/oauth2/rfc6749/endpoints/test_extra_credentials.py
@@ -2,11 +2,12 @@
"""
from unittest import mock
-from oauthlib.oauth2 import (BackendApplicationServer, LegacyApplicationServer,
- MobileApplicationServer, RequestValidator,
- WebApplicationServer)
+from oauthlib.oauth2 import (
+ BackendApplicationServer, LegacyApplicationServer, MobileApplicationServer,
+ RequestValidator, WebApplicationServer,
+)
-from ....unittest import TestCase
+from tests.unittest import TestCase
class ExtraCredentialsTest(TestCase):
diff --git a/tests/oauth2/rfc6749/endpoints/test_introspect_endpoint.py b/tests/oauth2/rfc6749/endpoints/test_introspect_endpoint.py
index 3c67673..04df6a2 100644
--- a/tests/oauth2/rfc6749/endpoints/test_introspect_endpoint.py
+++ b/tests/oauth2/rfc6749/endpoints/test_introspect_endpoint.py
@@ -1,12 +1,11 @@
# -*- coding: utf-8 -*-
from json import loads
-
from unittest.mock import MagicMock
from oauthlib.common import urlencode
-from oauthlib.oauth2 import RequestValidator, IntrospectEndpoint
+from oauthlib.oauth2 import IntrospectEndpoint, RequestValidator
-from ....unittest import TestCase
+from tests.unittest import TestCase
class IntrospectEndpointTest(TestCase):
diff --git a/tests/oauth2/rfc6749/endpoints/test_metadata.py b/tests/oauth2/rfc6749/endpoints/test_metadata.py
index a01500f..681119a 100644
--- a/tests/oauth2/rfc6749/endpoints/test_metadata.py
+++ b/tests/oauth2/rfc6749/endpoints/test_metadata.py
@@ -1,9 +1,7 @@
# -*- coding: utf-8 -*-
-from oauthlib.oauth2 import MetadataEndpoint
-from oauthlib.oauth2 import TokenEndpoint
-from oauthlib.oauth2 import Server
+from oauthlib.oauth2 import MetadataEndpoint, Server, TokenEndpoint
-from ....unittest import TestCase
+from tests.unittest import TestCase
class MetadataEndpointTest(TestCase):
diff --git a/tests/oauth2/rfc6749/endpoints/test_resource_owner_association.py b/tests/oauth2/rfc6749/endpoints/test_resource_owner_association.py
index 6280cac..0453388 100644
--- a/tests/oauth2/rfc6749/endpoints/test_resource_owner_association.py
+++ b/tests/oauth2/rfc6749/endpoints/test_resource_owner_association.py
@@ -1,14 +1,15 @@
"""Ensure all tokens are associated with a resource owner.
"""
import json
-
from unittest import mock
-from oauthlib.oauth2 import (BackendApplicationServer, LegacyApplicationServer,
- MobileApplicationServer, RequestValidator,
- WebApplicationServer)
+from oauthlib.oauth2 import (
+ BackendApplicationServer, LegacyApplicationServer, MobileApplicationServer,
+ RequestValidator, WebApplicationServer,
+)
+
+from tests.unittest import TestCase
-from ....unittest import TestCase
from .test_utils import get_fragment_credentials, get_query_credentials
diff --git a/tests/oauth2/rfc6749/endpoints/test_revocation_endpoint.py b/tests/oauth2/rfc6749/endpoints/test_revocation_endpoint.py
index 6bfba9a..a4182eb 100644
--- a/tests/oauth2/rfc6749/endpoints/test_revocation_endpoint.py
+++ b/tests/oauth2/rfc6749/endpoints/test_revocation_endpoint.py
@@ -1,12 +1,11 @@
# -*- coding: utf-8 -*-
from json import loads
-
from unittest.mock import MagicMock
from oauthlib.common import urlencode
from oauthlib.oauth2 import RequestValidator, RevocationEndpoint
-from ....unittest import TestCase
+from tests.unittest import TestCase
class RevocationEndpointTest(TestCase):
diff --git a/tests/oauth2/rfc6749/endpoints/test_scope_handling.py b/tests/oauth2/rfc6749/endpoints/test_scope_handling.py
index 0bf760b..4c87d9c 100644
--- a/tests/oauth2/rfc6749/endpoints/test_scope_handling.py
+++ b/tests/oauth2/rfc6749/endpoints/test_scope_handling.py
@@ -4,14 +4,15 @@ Fairly trivial in all grants except the Authorization Code Grant where scope
need to be persisted temporarily in an authorization code.
"""
import json
-
from unittest import mock
-from oauthlib.oauth2 import (BackendApplicationServer, LegacyApplicationServer,
- MobileApplicationServer, RequestValidator, Server,
- WebApplicationServer)
+from oauthlib.oauth2 import (
+ BackendApplicationServer, LegacyApplicationServer, MobileApplicationServer,
+ RequestValidator, Server, WebApplicationServer,
+)
+
+from tests.unittest import TestCase
-from ....unittest import TestCase
from .test_utils import get_fragment_credentials, get_query_credentials
diff --git a/tests/oauth2/rfc6749/grant_types/test_authorization_code.py b/tests/oauth2/rfc6749/grant_types/test_authorization_code.py
index a9e384f..20a2416 100644
--- a/tests/oauth2/rfc6749/grant_types/test_authorization_code.py
+++ b/tests/oauth2/rfc6749/grant_types/test_authorization_code.py
@@ -1,15 +1,15 @@
# -*- coding: utf-8 -*-
import json
-
from unittest import mock
from oauthlib.common import Request
from oauthlib.oauth2.rfc6749 import errors
-from oauthlib.oauth2.rfc6749.grant_types import AuthorizationCodeGrant
-from oauthlib.oauth2.rfc6749.grant_types import authorization_code
+from oauthlib.oauth2.rfc6749.grant_types import (
+ AuthorizationCodeGrant, authorization_code,
+)
from oauthlib.oauth2.rfc6749.tokens import BearerToken
-from ....unittest import TestCase
+from tests.unittest import TestCase
class AuthorizationCodeGrantTest(TestCase):
diff --git a/tests/oauth2/rfc6749/grant_types/test_client_credentials.py b/tests/oauth2/rfc6749/grant_types/test_client_credentials.py
index 0a45ef6..e9559c7 100644
--- a/tests/oauth2/rfc6749/grant_types/test_client_credentials.py
+++ b/tests/oauth2/rfc6749/grant_types/test_client_credentials.py
@@ -1,13 +1,12 @@
# -*- coding: utf-8 -*-
import json
-
from unittest import mock
from oauthlib.common import Request
from oauthlib.oauth2.rfc6749.grant_types import ClientCredentialsGrant
from oauthlib.oauth2.rfc6749.tokens import BearerToken
-from ....unittest import TestCase
+from tests.unittest import TestCase
class ClientCredentialsGrantTest(TestCase):
diff --git a/tests/oauth2/rfc6749/grant_types/test_implicit.py b/tests/oauth2/rfc6749/grant_types/test_implicit.py
index 4a0313d..1fb71a1 100644
--- a/tests/oauth2/rfc6749/grant_types/test_implicit.py
+++ b/tests/oauth2/rfc6749/grant_types/test_implicit.py
@@ -5,7 +5,7 @@ from oauthlib.common import Request
from oauthlib.oauth2.rfc6749.grant_types import ImplicitGrant
from oauthlib.oauth2.rfc6749.tokens import BearerToken
-from ....unittest import TestCase
+from tests.unittest import TestCase
class ImplicitGrantTest(TestCase):
diff --git a/tests/oauth2/rfc6749/grant_types/test_refresh_token.py b/tests/oauth2/rfc6749/grant_types/test_refresh_token.py
index 0d0fd37..1d3e77a 100644
--- a/tests/oauth2/rfc6749/grant_types/test_refresh_token.py
+++ b/tests/oauth2/rfc6749/grant_types/test_refresh_token.py
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
import json
-
from unittest import mock
from oauthlib.common import Request
@@ -8,7 +7,7 @@ from oauthlib.oauth2.rfc6749 import errors
from oauthlib.oauth2.rfc6749.grant_types import RefreshTokenGrant
from oauthlib.oauth2.rfc6749.tokens import BearerToken
-from ....unittest import TestCase
+from tests.unittest import TestCase
class RefreshTokenGrantTest(TestCase):
diff --git a/tests/oauth2/rfc6749/grant_types/test_resource_owner_password.py b/tests/oauth2/rfc6749/grant_types/test_resource_owner_password.py
index 42f0aa6..294e27b 100644
--- a/tests/oauth2/rfc6749/grant_types/test_resource_owner_password.py
+++ b/tests/oauth2/rfc6749/grant_types/test_resource_owner_password.py
@@ -1,15 +1,15 @@
# -*- coding: utf-8 -*-
import json
-
from unittest import mock
from oauthlib.common import Request
from oauthlib.oauth2.rfc6749 import errors
-from oauthlib.oauth2.rfc6749.grant_types import \
- ResourceOwnerPasswordCredentialsGrant
+from oauthlib.oauth2.rfc6749.grant_types import (
+ ResourceOwnerPasswordCredentialsGrant,
+)
from oauthlib.oauth2.rfc6749.tokens import BearerToken
-from ....unittest import TestCase
+from tests.unittest import TestCase
class ResourceOwnerPasswordCredentialsGrantTest(TestCase):
diff --git a/tests/oauth2/rfc6749/test_parameters.py b/tests/oauth2/rfc6749/test_parameters.py
index 4380447..f9245ec 100644
--- a/tests/oauth2/rfc6749/test_parameters.py
+++ b/tests/oauth2/rfc6749/test_parameters.py
@@ -4,7 +4,7 @@ from oauthlib import signals
from oauthlib.oauth2.rfc6749.errors import *
from oauthlib.oauth2.rfc6749.parameters import *
-from ...unittest import TestCase
+from tests.unittest import TestCase
@patch('time.time', new=lambda: 1000)
diff --git a/tests/oauth2/rfc6749/test_request_validator.py b/tests/oauth2/rfc6749/test_request_validator.py
index 257280c..9688b5a 100644
--- a/tests/oauth2/rfc6749/test_request_validator.py
+++ b/tests/oauth2/rfc6749/test_request_validator.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from oauthlib.oauth2 import RequestValidator
-from ...unittest import TestCase
+from tests.unittest import TestCase
class RequestValidatorTest(TestCase):
diff --git a/tests/oauth2/rfc6749/test_server.py b/tests/oauth2/rfc6749/test_server.py
index e6ad5cd..94af37e 100644
--- a/tests/oauth2/rfc6749/test_server.py
+++ b/tests/oauth2/rfc6749/test_server.py
@@ -1,20 +1,21 @@
# -*- coding: utf-8 -*-
import json
-
from unittest import mock
from oauthlib import common
from oauthlib.oauth2.rfc6749 import errors, tokens
from oauthlib.oauth2.rfc6749.endpoints import Server
-from oauthlib.oauth2.rfc6749.endpoints.authorization import AuthorizationEndpoint
+from oauthlib.oauth2.rfc6749.endpoints.authorization import (
+ AuthorizationEndpoint,
+)
from oauthlib.oauth2.rfc6749.endpoints.resource import ResourceEndpoint
from oauthlib.oauth2.rfc6749.endpoints.token import TokenEndpoint
-from oauthlib.oauth2.rfc6749.grant_types import (AuthorizationCodeGrant,
- ClientCredentialsGrant,
- ImplicitGrant,
- ResourceOwnerPasswordCredentialsGrant)
+from oauthlib.oauth2.rfc6749.grant_types import (
+ AuthorizationCodeGrant, ClientCredentialsGrant, ImplicitGrant,
+ ResourceOwnerPasswordCredentialsGrant,
+)
-from ...unittest import TestCase
+from tests.unittest import TestCase
class AuthorizationEndpointTest(TestCase):
diff --git a/tests/oauth2/rfc6749/test_tokens.py b/tests/oauth2/rfc6749/test_tokens.py
index 8402133..fa6b1c0 100644
--- a/tests/oauth2/rfc6749/test_tokens.py
+++ b/tests/oauth2/rfc6749/test_tokens.py
@@ -2,14 +2,11 @@ from unittest import mock
from oauthlib.common import Request
from oauthlib.oauth2.rfc6749.tokens import (
- BearerToken,
- prepare_bearer_body,
- prepare_bearer_headers,
- prepare_bearer_uri,
- prepare_mac_header,
+ BearerToken, prepare_bearer_body, prepare_bearer_headers,
+ prepare_bearer_uri, prepare_mac_header,
)
-from ...unittest import TestCase
+from tests.unittest import TestCase
class TokenTest(TestCase):
diff --git a/tests/oauth2/rfc6749/test_utils.py b/tests/oauth2/rfc6749/test_utils.py
index cfc6c2c..3299591 100644
--- a/tests/oauth2/rfc6749/test_utils.py
+++ b/tests/oauth2/rfc6749/test_utils.py
@@ -1,11 +1,12 @@
import datetime
import os
-from oauthlib.oauth2.rfc6749.utils import (escape, generate_age, host_from_uri,
- is_secure_transport, list_to_scope,
- params_from_uri, scope_to_list)
+from oauthlib.oauth2.rfc6749.utils import (
+ escape, generate_age, host_from_uri, is_secure_transport, list_to_scope,
+ params_from_uri, scope_to_list,
+)
-from ...unittest import TestCase
+from tests.unittest import TestCase
class ScopeObject: