summary refs log tree commit diff
path: root/tests/test_dns.py
diff options
context:
space:
mode:
authorNeil Johnson <neil@matrix.org>2018-08-15 16:31:40 +0100
committerNeil Johnson <neil@matrix.org>2018-08-15 16:31:40 +0100
commitfc5d937550816573bd151f5a322629d12846317d (patch)
tree5d7e59799bd513718ea3f78431aa8c4c7ab087b3 /tests/test_dns.py
parentwip cut at sending resource server notices (diff)
parentMerge pull request #3653 from matrix-org/erikj/split_federation (diff)
downloadsynapse-fc5d937550816573bd151f5a322629d12846317d.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into neilj/server_notices_on_blocking
Diffstat (limited to 'tests/test_dns.py')
-rw-r--r--tests/test_dns.py22
1 files changed, 6 insertions, 16 deletions
diff --git a/tests/test_dns.py b/tests/test_dns.py
index b647d92697..90bd34be34 100644
--- a/tests/test_dns.py
+++ b/tests/test_dns.py
@@ -27,7 +27,6 @@ from . import unittest
 
 @unittest.DEBUG
 class DnsTestCase(unittest.TestCase):
-
     @defer.inlineCallbacks
     def test_resolve(self):
         dns_client_mock = Mock()
@@ -36,14 +35,11 @@ class DnsTestCase(unittest.TestCase):
         host_name = "example.com"
 
         answer_srv = dns.RRHeader(
-            type=dns.SRV,
-            payload=dns.Record_SRV(
-                target=host_name,
-            )
+            type=dns.SRV, payload=dns.Record_SRV(target=host_name)
         )
 
         dns_client_mock.lookupService.return_value = defer.succeed(
-            ([answer_srv], None, None),
+            ([answer_srv], None, None)
         )
 
         cache = {}
@@ -68,9 +64,7 @@ class DnsTestCase(unittest.TestCase):
         entry = Mock(spec_set=["expires"])
         entry.expires = 0
 
-        cache = {
-            service_name: [entry]
-        }
+        cache = {service_name: [entry]}
 
         servers = yield resolve_service(
             service_name, dns_client=dns_client_mock, cache=cache
@@ -93,12 +87,10 @@ class DnsTestCase(unittest.TestCase):
         entry = Mock(spec_set=["expires"])
         entry.expires = 999999999
 
-        cache = {
-            service_name: [entry]
-        }
+        cache = {service_name: [entry]}
 
         servers = yield resolve_service(
-            service_name, dns_client=dns_client_mock, cache=cache, clock=clock,
+            service_name, dns_client=dns_client_mock, cache=cache, clock=clock
         )
 
         self.assertFalse(dns_client_mock.lookupService.called)
@@ -117,9 +109,7 @@ class DnsTestCase(unittest.TestCase):
         cache = {}
 
         with self.assertRaises(error.DNSServerError):
-            yield resolve_service(
-                service_name, dns_client=dns_client_mock, cache=cache
-            )
+            yield resolve_service(service_name, dns_client=dns_client_mock, cache=cache)
 
     @defer.inlineCallbacks
     def test_name_error(self):