From 453cb4410b829a9957ffd71aa93284a74722461e Mon Sep 17 00:00:00 2001 From: Jeffrey Forman Date: Thu, 6 Dec 2012 21:46:10 -0500 Subject: [PATCH] add test_Integration_ZoneList_ConnectionRefused --- binder/tests/integration.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/binder/tests/integration.py b/binder/tests/integration.py index 232a4df..43be73c 100644 --- a/binder/tests/integration.py +++ b/binder/tests/integration.py @@ -76,3 +76,15 @@ class Integration_Tests(TestCase): self.assertRegexpMatches(dns_update_output, "opcode UPDATE") self.assertRegexpMatches(dns_update_output, "rcode NOERROR") + + def test_Integration_ZoneList_ConnectionRefused(self): + """Confirm connection refused on a server zone list.""" + dns_server = models.BindServer.objects.get(hostname="testserver1") + original_statistics_port = dns_server.statistics_port + dns_server.statistics_port = 1234 + response = self.client.get("/info/testserver1/") + self.assertEqual(response.status_code, 200) + self.assertEqual(response.context["dns_server"], "testserver1") + self.assertEqual(response.context["zone_array"], {}) + self.assertEqual(response.context["errors"], "Unable to list server zones. Error: ") + dns_server.statistics_port = original_statistics_port