mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-12-18 16:52:13 -05:00
Require types in tests.storage. (#14646)
Adds missing type hints to `tests.storage` package and does not allow untyped definitions.
This commit is contained in:
parent
94bc21e69f
commit
3ac412b4e2
36 changed files with 489 additions and 341 deletions
|
|
@ -12,8 +12,12 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from twisted.test.proto_helpers import MemoryReactor
|
||||
|
||||
from synapse.rest import admin
|
||||
from synapse.rest.client import devices
|
||||
from synapse.server import HomeServer
|
||||
from synapse.util import Clock
|
||||
|
||||
from tests.unittest import HomeserverTestCase
|
||||
|
||||
|
|
@ -25,11 +29,11 @@ class DeviceInboxBackgroundUpdateStoreTestCase(HomeserverTestCase):
|
|||
devices.register_servlets,
|
||||
]
|
||||
|
||||
def prepare(self, reactor, clock, hs):
|
||||
def prepare(self, reactor: MemoryReactor, clock: Clock, hs: HomeServer) -> None:
|
||||
self.store = hs.get_datastores().main
|
||||
self.user_id = self.register_user("foo", "pass")
|
||||
|
||||
def test_background_remove_deleted_devices_from_device_inbox(self):
|
||||
def test_background_remove_deleted_devices_from_device_inbox(self) -> None:
|
||||
"""Test that the background task to delete old device_inboxes works properly."""
|
||||
|
||||
# create a valid device
|
||||
|
|
@ -89,7 +93,7 @@ class DeviceInboxBackgroundUpdateStoreTestCase(HomeserverTestCase):
|
|||
self.assertEqual(1, len(res))
|
||||
self.assertEqual(res[0], "cur_device")
|
||||
|
||||
def test_background_remove_hidden_devices_from_device_inbox(self):
|
||||
def test_background_remove_hidden_devices_from_device_inbox(self) -> None:
|
||||
"""Test that the background task to delete hidden devices
|
||||
from device_inboxes works properly."""
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue