summary refs log tree commit diff
path: root/tests/test_dns.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-08-15 14:25:46 +0100
committerErik Johnston <erik@matrix.org>2018-08-15 14:25:46 +0100
commitef184caf30e69593b5f224f4a0ffde3605da2153 (patch)
treec4affbe31ecedbee84ddf70bfc2f2c39d15e831a /tests/test_dns.py
parentUse federation handler function rather than duplicate (diff)
parentMerge pull request #3690 from matrix-org/neilj/change_prometheus_mau_metric_name (diff)
downloadsynapse-ef184caf30e69593b5f224f4a0ffde3605da2153.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/split_federation
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):