mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 21:04:50 -04:00
Add basic tests for sync/pagination with vector clock tokens. (#8488)
These are tests for #8439
This commit is contained in:
parent
921a3f8a59
commit
1264c8ac89
3 changed files with 249 additions and 1 deletions
|
@ -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],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue