mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 10:46:06 -04:00
Add type hints for tests/unittest.py
. (#12347)
In particular, add type hints for get_success and friends, which are then helpful in a bunch of places.
This commit is contained in:
parent
33ebee47e4
commit
f0b03186d9
12 changed files with 97 additions and 48 deletions
|
@ -22,7 +22,6 @@ import warnings
|
|||
from collections import deque
|
||||
from io import SEEK_END, BytesIO
|
||||
from typing import (
|
||||
AnyStr,
|
||||
Callable,
|
||||
Dict,
|
||||
Iterable,
|
||||
|
@ -86,6 +85,9 @@ from tests.utils import (
|
|||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# the type of thing that can be passed into `make_request` in the headers list
|
||||
CustomHeaderType = Tuple[Union[str, bytes], Union[str, bytes]]
|
||||
|
||||
|
||||
class TimedOutException(Exception):
|
||||
"""
|
||||
|
@ -260,7 +262,7 @@ def make_request(
|
|||
federation_auth_origin: Optional[bytes] = None,
|
||||
content_is_form: bool = False,
|
||||
await_result: bool = True,
|
||||
custom_headers: Optional[Iterable[Tuple[AnyStr, AnyStr]]] = None,
|
||||
custom_headers: Optional[Iterable[CustomHeaderType]] = None,
|
||||
client_ip: str = "127.0.0.1",
|
||||
) -> FakeChannel:
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue