diff options
author | Richard van der Hoff <richard@matrix.org> | 2020-12-02 18:22:01 +0000 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2020-12-02 18:30:29 +0000 |
commit | 76469898ee797db232adaccb9fd547bddab2fe59 (patch) | |
tree | ab6aa31d692e103b01f01577ee1d65d62960ae72 /tests/handlers | |
parent | fix up various test cases (diff) | |
download | synapse-76469898ee797db232adaccb9fd547bddab2fe59.tar.xz |
Factor out FakeResponse from test_oidc
Diffstat (limited to 'tests/handlers')
-rw-r--r-- | tests/handlers/test_oidc.py | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/tests/handlers/test_oidc.py b/tests/handlers/test_oidc.py index d485af52fd..23ea1e3543 100644 --- a/tests/handlers/test_oidc.py +++ b/tests/handlers/test_oidc.py @@ -17,30 +17,15 @@ from urllib.parse import parse_qs, urlparse from mock import Mock, patch -import attr import pymacaroons -from twisted.python.failure import Failure -from twisted.web._newclient import ResponseDone - from synapse.handlers.oidc_handler import OidcError, OidcMappingProvider from synapse.handlers.sso import MappingException from synapse.types import UserID +from tests.test_utils import FakeResponse from tests.unittest import HomeserverTestCase, override_config - -@attr.s -class FakeResponse: - code = attr.ib() - body = attr.ib() - phrase = attr.ib() - - def deliverBody(self, protocol): - protocol.dataReceived(self.body) - protocol.connectionLost(Failure(ResponseDone())) - - # These are a few constants that are used as config parameters in the tests. ISSUER = "https://issuer/" CLIENT_ID = "test-client-id" |