Use default_config method.
parent
ef2e79f2d1
commit
1ab9ad13e2
|
@ -127,13 +127,8 @@ async def get_json(url):
|
|||
|
||||
|
||||
class OidcHandlerTestCase(HomeserverTestCase):
|
||||
def make_homeserver(self, reactor, clock):
|
||||
|
||||
self.http_client = Mock(spec=["get_json"])
|
||||
self.http_client.get_json.side_effect = get_json
|
||||
self.http_client.user_agent = "Synapse Test"
|
||||
|
||||
config = self.default_config()
|
||||
def default_config(self):
|
||||
config = super().default_config()
|
||||
config["public_baseurl"] = BASE_URL
|
||||
oidc_config = {
|
||||
"enabled": True,
|
||||
|
@ -149,10 +144,17 @@ class OidcHandlerTestCase(HomeserverTestCase):
|
|||
oidc_config.update(config.get("oidc_config", {}))
|
||||
config["oidc_config"] = oidc_config
|
||||
|
||||
return config
|
||||
|
||||
def make_homeserver(self, reactor, clock):
|
||||
|
||||
self.http_client = Mock(spec=["get_json"])
|
||||
self.http_client.get_json.side_effect = get_json
|
||||
self.http_client.user_agent = "Synapse Test"
|
||||
|
||||
hs = self.setup_test_homeserver(
|
||||
http_client=self.http_client,
|
||||
proxied_http_client=self.http_client,
|
||||
config=config,
|
||||
)
|
||||
|
||||
self.handler = hs.get_oidc_handler()
|
||||
|
|
|
@ -50,8 +50,8 @@ class TestMappingProvider:
|
|||
|
||||
|
||||
class SamlHandlerTestCase(HomeserverTestCase):
|
||||
def make_homeserver(self, reactor, clock):
|
||||
config = self.default_config()
|
||||
def default_config(self):
|
||||
config = super().default_config()
|
||||
config["public_baseurl"] = BASE_URL
|
||||
saml_config = {
|
||||
"sp_config": {"metadata": {}},
|
||||
|
@ -61,9 +61,10 @@ class SamlHandlerTestCase(HomeserverTestCase):
|
|||
}
|
||||
config["saml2_config"] = saml_config
|
||||
|
||||
hs = self.setup_test_homeserver(
|
||||
config=config,
|
||||
)
|
||||
return config
|
||||
|
||||
def make_homeserver(self, reactor, clock):
|
||||
hs = self.setup_test_homeserver()
|
||||
|
||||
self.handler = hs.get_saml_handler()
|
||||
|
||||
|
|
Loading…
Reference in New Issue