Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Remove spurious "name" parameter to default_config
Browse files Browse the repository at this point in the history
this is never set to anything other than "test", and is a source of unnecessary
boilerplate.
  • Loading branch information
richvdh committed Mar 24, 2020
1 parent 1fcf9c6 commit 28d9d6e
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 19 deletions.
4 changes: 2 additions & 2 deletions tests/app/test_frontend_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def make_homeserver(self, reactor, clock):

return hs

def default_config(self, name="test"):
c = super().default_config(name)
def default_config(self):
c = super().default_config()
c["worker_app"] = "synapse.app.frontend_proxy"
return c

Expand Down
4 changes: 2 additions & 2 deletions tests/app/test_openid_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ def make_homeserver(self, reactor, clock):
)
return hs

def default_config(self, name="test"):
conf = super().default_config(name)
def default_config(self):
conf = super().default_config()
# we're using FederationReaderServer, which uses a SlavedStore, so we
# have to tell the FederationHandler not to try to access stuff that is only
# in the primary store.
Expand Down
4 changes: 2 additions & 2 deletions tests/federation/test_complexity.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class RoomComplexityTests(unittest.FederatingHomeserverTestCase):
login.register_servlets,
]

def default_config(self, name="test"):
config = super().default_config(name=name)
def default_config(self):
config = super().default_config()
config["limit_remote_rooms"] = {"enabled": True, "complexity": 0.05}
return config

Expand Down
2 changes: 1 addition & 1 deletion tests/handlers/test_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class RegistrationTestCase(unittest.HomeserverTestCase):
""" Tests the RegistrationHandler. """

def make_homeserver(self, reactor, clock):
hs_config = self.default_config("test")
hs_config = self.default_config()

# some of the tests rely on us having a user consent version
hs_config["user_consent"] = {
Expand Down
4 changes: 2 additions & 2 deletions tests/rest/client/v2_alpha/test_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ class RegisterRestServletTestCase(unittest.HomeserverTestCase):
servlets = [register.register_servlets]
url = b"/_matrix/client/r0/register"

def default_config(self, name="test"):
config = super().default_config(name)
def default_config(self):
config = super().default_config()
config["allow_guest_access"] = True
return config

Expand Down
4 changes: 2 additions & 2 deletions tests/rest/key/v2/test_remote_key_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ class EndToEndPerspectivesTests(BaseRemoteKeyResourceTestCase):
endpoint, to check that the two implementations are compatible.
"""

def default_config(self, *args, **kwargs):
config = super().default_config(*args, **kwargs)
def default_config(self):
config = super().default_config()

# replace the signing key with our own
self.hs_signing_key = signedjson.key.generate_signing_key("kssk")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

class TestResourceLimitsServerNotices(unittest.HomeserverTestCase):
def make_homeserver(self, reactor, clock):
hs_config = self.default_config("test")
hs_config = self.default_config()
hs_config["server_notices"] = {
"system_mxid_localpart": "server",
"system_mxid_display_name": "test display name",
Expand Down
4 changes: 2 additions & 2 deletions tests/test_terms_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
class TermsTestCase(unittest.HomeserverTestCase):
servlets = [register_servlets]

def default_config(self, name="test"):
config = super().default_config(name)
def default_config(self):
config = super().default_config()
config.update(
{
"public_baseurl": "https://example.org/",
Expand Down
7 changes: 2 additions & 5 deletions tests/unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,14 +311,11 @@ def create_test_json_resource(self):

return resource

def default_config(self, name="test"):
def default_config(self):
"""
Get a default HomeServer config dict.
Args:
name (str): The homeserver name/domain.
"""
config = default_config(name)
config = default_config("test")

# apply any additional config which was specified via the override_config
# decorator.
Expand Down

0 comments on commit 28d9d6e

Please sign in to comment.