Skip to content

Commit 3ce5376

Browse files
author
Aaron Sierra
committed
dns: nsone: Add test_get_zone_success()
The MockHttp function was defined, but the corresponding test was not.
1 parent 98643cc commit 3ce5376

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

libcloud/test/dns/test_nsone.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,15 @@ def test_get_zone_zone_does_not_exist(self):
111111
else:
112112
self.fail("Exception was not thrown")
113113

114+
def test_get_zone_success(self):
115+
NsOneMockHttp.type = "GET_ZONE_SUCCESS"
116+
zone = self.driver.get_zone(zone_id="example.com")
117+
118+
self.assertEqual(zone.id, "example.com")
119+
self.assertEqual(zone.domain, "example.com")
120+
self.assertIsNone(zone.type),
121+
self.assertEqual(zone.ttl, 3600)
122+
114123
def test_create_zone_success(self):
115124
NsOneMockHttp.type = "CREATE_ZONE_SUCCESS"
116125
zone = self.driver.create_zone(domain="newzone.com")
@@ -250,7 +259,7 @@ def _v1_zones(self, method, url, body, headers):
250259

251260
return httplib.OK, body, {}, httplib.responses[httplib.OK]
252261

253-
def _v1_zones_getzone_com_GET_ZONE_SUCCESS(self, method, url, body, headers):
262+
def _v1_zones_example_com_GET_ZONE_SUCCESS(self, method, url, body, headers):
254263
body = self.fixtures.load("get_zone_success.json")
255264

256265
return httplib.OK, body, {}, httplib.responses[httplib.OK]
@@ -331,9 +340,7 @@ def _v1_zones_example_com_example_com_A_GET_RECORD_DOES_NOT_EXIST(
331340
def _v1_zones_example_com_GET_RECORD_DOES_NOT_EXIST(self, method, url, body, headers):
332341
return self._v1_zones_example_com_GET_RECORD_SUCCESS(method, url, body, headers)
333342

334-
def _v1_zones_test_com_test_com_A_CREATE_RECORD_SUCCESS(
335-
self, method, url, body, headers
336-
):
343+
def _v1_zones_test_com_test_com_A_CREATE_RECORD_SUCCESS(self, method, url, body, headers):
337344
body = self.fixtures.load("create_record_success.json")
338345

339346
return httplib.OK, body, {}, httplib.responses[httplib.OK]

0 commit comments

Comments
 (0)