mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-10 10:10:01 -04:00
Add final type hint to tests.unittest. (#15072)
Adds a return type to HomeServerTestCase.make_homeserver and deal with any variables which are no longer Any.
This commit is contained in:
parent
119e0795a5
commit
42aea0d8af
55 changed files with 433 additions and 320 deletions
|
@ -151,7 +151,7 @@ class RegisterRestServletTestCase(unittest.HomeserverTestCase):
|
|||
self.assertEqual(channel.json_body["errcode"], "M_FORBIDDEN")
|
||||
|
||||
def test_POST_guest_registration(self) -> None:
|
||||
self.hs.config.key.macaroon_secret_key = "test"
|
||||
self.hs.config.key.macaroon_secret_key = b"test"
|
||||
self.hs.config.registration.allow_guest_access = True
|
||||
|
||||
channel = self.make_request(b"POST", self.url + b"?kind=guest", b"{}")
|
||||
|
@ -1166,12 +1166,15 @@ class AccountValidityBackgroundJobTestCase(unittest.HomeserverTestCase):
|
|||
"""
|
||||
user_id = self.register_user("kermit_delta", "user")
|
||||
|
||||
self.hs.config.account_validity.startup_job_max_delta = self.max_delta
|
||||
self.hs.config.account_validity.account_validity_startup_job_max_delta = (
|
||||
self.max_delta
|
||||
)
|
||||
|
||||
now_ms = self.hs.get_clock().time_msec()
|
||||
self.get_success(self.store._set_expiration_date_when_missing())
|
||||
|
||||
res = self.get_success(self.store.get_expiration_ts_for_user(user_id))
|
||||
assert res is not None
|
||||
|
||||
self.assertGreaterEqual(res, now_ms + self.validity_period - self.max_delta)
|
||||
self.assertLessEqual(res, now_ms + self.validity_period)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue