diff options
author | Erik Johnston <erik@matrix.org> | 2020-10-14 13:53:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-14 13:53:20 +0100 |
commit | 1264c8ac89e5bfa757acee8d26437f14621206a4 (patch) | |
tree | 26f8188ef6fc0400851f18668db8b9733ad63659 /tests/unittest.py | |
parent | Fix not sending events over federation when using sharded event persisters (#... (diff) | |
download | synapse-1264c8ac89e5bfa757acee8d26437f14621206a4.tar.xz |
Add basic tests for sync/pagination with vector clock tokens. (#8488)
These are tests for #8439
Diffstat (limited to 'tests/unittest.py')
-rw-r--r-- | tests/unittest.py | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/tests/unittest.py b/tests/unittest.py index 6c1661c92c..040b126a27 100644 --- a/tests/unittest.py +++ b/tests/unittest.py @@ -20,7 +20,7 @@ import hmac import inspect import logging import time -from typing import Optional, Tuple, Type, TypeVar, Union +from typing import Optional, Tuple, Type, TypeVar, Union, overload from mock import Mock, patch @@ -364,6 +364,36 @@ class HomeserverTestCase(TestCase): Function to optionally be overridden in subclasses. """ + # Annoyingly mypy doesn't seem to pick up the fact that T is SynapseRequest + # when the `request` arg isn't given, so we define an explicit override to + # cover that case. + @overload + def make_request( + self, + method: Union[bytes, str], + path: Union[bytes, str], + content: Union[bytes, dict] = b"", + access_token: Optional[str] = None, + shorthand: bool = True, + federation_auth_origin: str = None, + content_is_form: bool = False, + ) -> Tuple[SynapseRequest, FakeChannel]: + ... + + @overload + def make_request( + self, + method: Union[bytes, str], + path: Union[bytes, str], + content: Union[bytes, dict] = b"", + access_token: Optional[str] = None, + request: Type[T] = SynapseRequest, + shorthand: bool = True, + federation_auth_origin: str = None, + content_is_form: bool = False, + ) -> Tuple[T, FakeChannel]: + ... + def make_request( self, method: Union[bytes, str], |