summary refs log tree commit diff
path: root/tests/server.py
diff options
context:
space:
mode:
authorWill Hunt <will@half-shot.uk>2018-07-27 12:26:52 +0100
committerWill Hunt <will@half-shot.uk>2018-07-27 12:26:52 +0100
commit46afacc215db24b128e502c2c23cc3f3205d6f70 (patch)
treeeb8bd164bcc1b49b507e4d41c900325bcbfc5a5a /tests/server.py
parentAuth media/r0/config (diff)
parentMerge pull request #3391 from t3chguy/t3chguy/default_inviter_display_name_3pid (diff)
downloadsynapse-46afacc215db24b128e502c2c23cc3f3205d6f70.tar.xz
Merge remote-tracking branch 'upstream/develop' into hs/upload-limits
Diffstat (limited to 'tests/server.py')
-rw-r--r--tests/server.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/server.py b/tests/server.py

index 46223ccf05..c611dd6059 100644 --- a/tests/server.py +++ b/tests/server.py
@@ -22,7 +22,7 @@ class FakeChannel(object): wire). """ - result = attr.ib(factory=dict) + result = attr.ib(default=attr.Factory(dict)) @property def json_body(self): @@ -80,6 +80,11 @@ def make_request(method, path, content=b""): content, and return the Request and the Channel underneath. """ + # Decorate it to be the full path + if not path.startswith(b"/_matrix"): + path = b"/_matrix/client/r0/" + path + path = path.replace("//", "/") + if isinstance(content, text_type): content = content.encode('utf8') @@ -110,6 +115,11 @@ def wait_until_result(clock, channel, timeout=100): clock.advance(0.1) +def render(request, resource, clock): + request.render(resource) + wait_until_result(clock, request._channel) + + class ThreadedMemoryReactorClock(MemoryReactorClock): """ A MemoryReactorClock that supports callFromThread.