Use direct references for some configuration variables (#10798)

Instead of proxying through the magic getter of the RootConfig
object. This should be more performant (and is more explicit).
This commit is contained in:
Patrick Cloke 2021-09-13 13:07:12 -04:00 committed by GitHub
parent 9f111075e8
commit 01c88a09cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
66 changed files with 152 additions and 133 deletions

View file

@ -23,10 +23,13 @@ class WellKnownTests(unittest.HomeserverTestCase):
# replace the JsonResource with a WellKnownResource
return WellKnownResource(self.hs)
@unittest.override_config(
{
"public_baseurl": "https://tesths",
"default_identity_server": "https://testis",
}
)
def test_well_known(self):
self.hs.config.public_baseurl = "https://tesths"
self.hs.config.default_identity_server = "https://testis"
channel = self.make_request(
"GET", "/.well-known/matrix/client", shorthand=False
)
@ -35,14 +38,17 @@ class WellKnownTests(unittest.HomeserverTestCase):
self.assertEqual(
channel.json_body,
{
"m.homeserver": {"base_url": "https://tesths"},
"m.homeserver": {"base_url": "https://tesths/"},
"m.identity_server": {"base_url": "https://testis"},
},
)
@unittest.override_config(
{
"public_baseurl": None,
}
)
def test_well_known_no_public_baseurl(self):
self.hs.config.public_baseurl = None
channel = self.make_request(
"GET", "/.well-known/matrix/client", shorthand=False
)