summary refs log tree commit diff
path: root/tests/http/test_fedclient.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2019-03-20 10:50:44 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2019-03-20 10:50:44 +0000
commit94cb7939e4d608500396b65d5c68dd936503ba69 (patch)
tree9885f2324bc32d4185fd30d8067617eefd0232e3 /tests/http/test_fedclient.py
parentlint (diff)
downloadsynapse-94cb7939e4d608500396b65d5c68dd936503ba69.tar.xz
Federation test fixed!
Diffstat (limited to 'tests/http/test_fedclient.py')
-rw-r--r--tests/http/test_fedclient.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/http/test_fedclient.py b/tests/http/test_fedclient.py

index 84216db44f..b1b3a025ef 100644 --- a/tests/http/test_fedclient.py +++ b/tests/http/test_fedclient.py
@@ -278,6 +278,7 @@ class FederationClientTests(HomeserverTestCase): "testserv:8008", "foo/bar", try_trailing_slash_on_400=True, ) + # Send the request self.pump() # there should have been a call to connectTCP @@ -293,6 +294,9 @@ class FederationClientTests(HomeserverTestCase): # that should have made it send the request to the connection self.assertRegex(conn.value(), b"^GET /foo/bar") + # Clear the original request data before sending a response + conn.clear() + # Send the HTTP response client.dataReceived( b"HTTP/1.1 400 Bad Request\r\n" @@ -302,7 +306,7 @@ class FederationClientTests(HomeserverTestCase): b'{"errcode":"M_UNRECOGNIZED","error":"Unrecognized request"}' ) - # We should get another request wiht a trailing slash + # We should get another request with a trailing slash self.assertRegex(conn.value(), b"^GET /foo/bar/") # Send a happy response this time @@ -316,7 +320,6 @@ class FederationClientTests(HomeserverTestCase): # We should get a successful response r = self.successResultOf(d) - self.assertEqual(r.code, 200) self.assertEqual(r, {}) def test_client_sends_body(self):