mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-28 10:22:13 -04:00
Add missing types to tests.util. (#14597)
Removes files under tests.util from the ignored by list, then fully types all tests/util/*.py files.
This commit is contained in:
parent
fac8a38525
commit
acea4d7a2f
21 changed files with 361 additions and 276 deletions
|
@ -21,14 +21,14 @@ from tests.unittest import TestCase
|
|||
|
||||
|
||||
class MacaroonGeneratorTestCase(TestCase):
|
||||
def setUp(self):
|
||||
def setUp(self) -> None:
|
||||
self.reactor, hs_clock = get_clock()
|
||||
self.macaroon_generator = MacaroonGenerator(hs_clock, "tesths", b"verysecret")
|
||||
self.other_macaroon_generator = MacaroonGenerator(
|
||||
hs_clock, "tesths", b"anothersecretkey"
|
||||
)
|
||||
|
||||
def test_guest_access_token(self):
|
||||
def test_guest_access_token(self) -> None:
|
||||
"""Test the generation and verification of guest access tokens"""
|
||||
token = self.macaroon_generator.generate_guest_access_token("@user:tesths")
|
||||
user_id = self.macaroon_generator.verify_guest_token(token)
|
||||
|
@ -47,7 +47,7 @@ class MacaroonGeneratorTestCase(TestCase):
|
|||
with self.assertRaises(MacaroonVerificationFailedException):
|
||||
self.macaroon_generator.verify_guest_token(token)
|
||||
|
||||
def test_delete_pusher_token(self):
|
||||
def test_delete_pusher_token(self) -> None:
|
||||
"""Test the generation and verification of delete_pusher tokens"""
|
||||
token = self.macaroon_generator.generate_delete_pusher_token(
|
||||
"@user:tesths", "m.mail", "john@example.com"
|
||||
|
@ -84,7 +84,7 @@ class MacaroonGeneratorTestCase(TestCase):
|
|||
)
|
||||
self.assertEqual(user_id, "@user:tesths")
|
||||
|
||||
def test_oidc_session_token(self):
|
||||
def test_oidc_session_token(self) -> None:
|
||||
"""Test the generation and verification of OIDC session cookies"""
|
||||
state = "arandomstate"
|
||||
session_data = OidcSessionData(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue