mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 21:04:50 -04:00
Update test_typing to use HomeserverTestCase. (#4771)
This commit is contained in:
parent
3064952939
commit
2c3548d9d8
5 changed files with 176 additions and 179 deletions
|
@ -262,6 +262,7 @@ class HomeserverTestCase(TestCase):
|
|||
access_token=None,
|
||||
request=SynapseRequest,
|
||||
shorthand=True,
|
||||
federation_auth_origin=None,
|
||||
):
|
||||
"""
|
||||
Create a SynapseRequest at the path using the method and containing the
|
||||
|
@ -275,15 +276,18 @@ class HomeserverTestCase(TestCase):
|
|||
a dict.
|
||||
shorthand: Whether to try and be helpful and prefix the given URL
|
||||
with the usual REST API path, if it doesn't contain it.
|
||||
federation_auth_origin (bytes|None): if set to not-None, we will add a fake
|
||||
Authorization header pretenting to be the given server name.
|
||||
|
||||
Returns:
|
||||
A synapse.http.site.SynapseRequest.
|
||||
Tuple[synapse.http.site.SynapseRequest, channel]
|
||||
"""
|
||||
if isinstance(content, dict):
|
||||
content = json.dumps(content).encode('utf8')
|
||||
|
||||
return make_request(
|
||||
self.reactor, method, path, content, access_token, request, shorthand
|
||||
self.reactor, method, path, content, access_token, request, shorthand,
|
||||
federation_auth_origin,
|
||||
)
|
||||
|
||||
def render(self, request):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue