mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 04:04:54 -04:00
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:
parent
6964ea095b
commit
b6b57ecb4e
3 changed files with 8 additions and 17 deletions
|
@ -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"/")))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue