Kill off redundant SynapseRequestFactory (#6619)

We already get the Site via the Channel, so there's no need for a dedicated
RequestFactory: we can just use the right constructor.
This commit is contained in:
Richard van der Hoff 2020-01-03 14:19:48 +00:00 committed by GitHub
parent 6964ea095b
commit b6b57ecb4e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 17 deletions

View file

@ -20,6 +20,7 @@ from twisted.python.failure import Failure
from twisted.test.proto_helpers import AccumulatingProtocol, MemoryReactorClock
from twisted.web.http import unquote
from twisted.web.http_headers import Headers
from twisted.web.server import Site
from synapse.http.site import SynapseRequest
from synapse.util import Clock
@ -42,6 +43,7 @@ class FakeChannel(object):
wire).
"""
site = attr.ib(type=Site)
_reactor = attr.ib()
result = attr.ib(default=attr.Factory(dict))
_producer = None
@ -176,9 +178,9 @@ def make_request(
content = content.encode("utf8")
site = FakeSite()
channel = FakeChannel(reactor)
channel = FakeChannel(site, reactor)
req = request(site, channel)
req = request(channel)
req.process = lambda: b""
req.content = BytesIO(content)
req.postpath = list(map(unquote, path[1:].split(b"/")))