summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2014-10-02 14:09:15 +0100
committerMark Haines <mark.haines@matrix.org>2014-10-02 14:26:13 +0100
commit574377636ee4eafba50580fc4d7a1d0793774332 (patch)
tree2d8bcaafa39c69dbece39f0d5c28503ebf1efe36 /tests
parentMerge branch 'master' into develop (diff)
downloadsynapse-574377636ee4eafba50580fc4d7a1d0793774332.tar.xz
Add a keyword argument to get_json to avoid retrying on DNS failures. Rather than passing MatrixHttpClient.RETRY_DNS_LOOKUP_FAILURES as a fake query string parameter
Diffstat (limited to 'tests')
-rw-r--r--tests/federation/test_federation.py5
-rw-r--r--tests/handlers/test_directory.py5
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/federation/test_federation.py b/tests/federation/test_federation.py
index bb17e9aafe..d95b9013a3 100644
--- a/tests/federation/test_federation.py
+++ b/tests/federation/test_federation.py
@@ -253,7 +253,7 @@ class FederationTestCase(unittest.TestCase):
         response = yield self.federation.make_query(
             destination="remote",
             query_type="a-question",
-            args={"one": "1", "two": "2"}
+            args={"one": "1", "two": "2"},
         )
 
         self.assertEquals({"your": "response"}, response)
@@ -261,7 +261,8 @@ class FederationTestCase(unittest.TestCase):
         self.mock_http_client.get_json.assert_called_with(
             destination="remote",
             path="/_matrix/federation/v1/query/a-question",
-            args={"one": "1", "two": "2"}
+            args={"one": "1", "two": "2"},
+            retry_on_dns_fail=True,
         )
 
     @defer.inlineCallbacks
diff --git a/tests/handlers/test_directory.py b/tests/handlers/test_directory.py
index 0c31502dd4..e10a49a8ac 100644
--- a/tests/handlers/test_directory.py
+++ b/tests/handlers/test_directory.py
@@ -20,7 +20,6 @@ from twisted.internet import defer
 from mock import Mock
 
 from synapse.server import HomeServer
-from synapse.http.client import MatrixHttpClient
 from synapse.handlers.directory import DirectoryHandler
 from synapse.storage.directory import RoomAliasMapping
 
@@ -95,8 +94,8 @@ class DirectoryTestCase(unittest.TestCase):
             query_type="directory",
             args={
                 "room_alias": "#another:remote",
-                MatrixHttpClient.RETRY_DNS_LOOKUP_FAILURES: False
-            }
+            },
+            retry_on_dns_fail=False,
         )
 
     @defer.inlineCallbacks