summary refs log tree commit diff
path: root/tests/federation/test_federation.py
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew.hodgson@openmarket.com>2014-08-13 16:14:30 +0100
committerMatthew Hodgson <matthew.hodgson@openmarket.com>2014-08-13 16:14:30 +0100
commit2ec5f6c2f2bccca6fe3004fd7d4c2632428a4ba5 (patch)
tree93449489f2a1244b4f807f79fed5e23446d60e56 /tests/federation/test_federation.py
parenttimestamps (diff)
parentDon't pass host_web_client flag to register_servlets, it needs to be a Resour... (diff)
downloadsynapse-2ec5f6c2f2bccca6fe3004fd7d4c2632428a4ba5.tar.xz
Merge branch 'master' of git+ssh://github.com/matrix-org/synapse
Diffstat (limited to 'tests/federation/test_federation.py')
-rw-r--r--tests/federation/test_federation.py29
1 files changed, 22 insertions, 7 deletions
diff --git a/tests/federation/test_federation.py b/tests/federation/test_federation.py
index 1792f9de56..f493ee253e 100644
--- a/tests/federation/test_federation.py
+++ b/tests/federation/test_federation.py
@@ -1,3 +1,17 @@
+# Copyright 2014 matrix.org
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 # trial imports
 from twisted.internet import defer
 from twisted.trial import unittest
@@ -82,7 +96,7 @@ class FederationTestCase(unittest.TestCase):
 
         # Empty context initially
         (code, response) = yield self.mock_http_server.trigger("GET",
-                "/state/my-context/", None)
+                "/matrix/federation/v1/state/my-context/", None)
         self.assertEquals(200, code)
         self.assertFalse(response["pdus"])
 
@@ -107,7 +121,7 @@ class FederationTestCase(unittest.TestCase):
         )
 
         (code, response) = yield self.mock_http_server.trigger("GET",
-                "/state/my-context/", None)
+                "/matrix/federation/v1/state/my-context/", None)
         self.assertEquals(200, code)
         self.assertEquals(1, len(response["pdus"]))
 
@@ -118,7 +132,7 @@ class FederationTestCase(unittest.TestCase):
         )
 
         (code, response) = yield self.mock_http_server.trigger("GET",
-                "/pdu/red/abc123def456/", None)
+                "/matrix/federation/v1/pdu/red/abc123def456/", None)
         self.assertEquals(404, code)
 
         # Now insert such a PDU
@@ -137,7 +151,7 @@ class FederationTestCase(unittest.TestCase):
         )
 
         (code, response) = yield self.mock_http_server.trigger("GET",
-                "/pdu/red/abc123def456/", None)
+                "/matrix/federation/v1/pdu/red/abc123def456/", None)
         self.assertEquals(200, code)
         self.assertEquals(1, len(response["pdus"]))
         self.assertEquals("m.text", response["pdus"][0]["pdu_type"])
@@ -163,7 +177,7 @@ class FederationTestCase(unittest.TestCase):
 
         self.mock_http_client.put_json.assert_called_with(
                 "remote",
-                path="/send/1000000/",
+                path="/matrix/federation/v1/send/1000000/",
                 data={
                     "ts": 1000000,
                     "origin": "test",
@@ -198,7 +212,7 @@ class FederationTestCase(unittest.TestCase):
         # MockClock ensures we can guess these timestamps
         self.mock_http_client.put_json.assert_called_with(
                 "remote",
-                path="/send/1000000/",
+                path="/matrix/federation/v1/send/1000000/",
                 data={
                     "origin": "test",
                     "ts": 1000000,
@@ -220,7 +234,8 @@ class FederationTestCase(unittest.TestCase):
 
         self.federation.register_edu_handler("m.test", recv_observer)
 
-        yield self.mock_http_server.trigger("PUT", "/send/1001000/",
+        yield self.mock_http_server.trigger("PUT",
+                "/matrix/federation/v1/send/1001000/",
                 """{
                     "origin": "remote",
                     "ts": 1001000,