Skip to content

Commit 7f11904

Browse files
author
Aaron Sierra
committed
dns: nsone: Fix test_list_records_success()
Previously, test_list_records_success() succeeded when receiving records completely unrelated to the originating .list_records() request. Update the request to align with the expected response.
1 parent 098a504 commit 7f11904

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

libcloud/test/dns/test_nsone.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ def setUp(self):
3737
NsOneMockHttp.type = None
3838
NsOneDNSDriver.connectionCls.conn_class = NsOneMockHttp
3939
self.driver = NsOneDNSDriver(*DNS_PARAMS_NSONE)
40+
self.example_zone = Zone(
41+
id="example.com",
42+
type="master",
43+
ttl=None,
44+
domain="example.com",
45+
extra={},
46+
driver=self,
47+
)
4048
self.test_zone = Zone(
4149
id="test.com",
4250
type="master",
@@ -159,7 +167,7 @@ def test_list_records_empty(self):
159167

160168
def test_list_records_success(self):
161169
NsOneMockHttp.type = "LIST_RECORDS_SUCCESS"
162-
records = self.driver.list_records(zone=self.test_zone)
170+
records = self.driver.list_records(zone=self.example_zone)
163171
self.assertEqual(len(records), 2)
164172

165173
arecord = records[1]
@@ -274,7 +282,7 @@ def _v1_zones_newzone_com_CREATE_ZONE_ZONE_ALREADY_EXISTS(self, method, url, bod
274282

275283
return httplib.OK, body, {}, httplib.responses[httplib.OK]
276284

277-
def _v1_zones_test_com_LIST_RECORDS_SUCCESS(self, method, url, body, headers):
285+
def _v1_zones_example_com_LIST_RECORDS_SUCCESS(self, method, url, body, headers):
278286
body = self.fixtures.load("get_zone_success.json")
279287

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

0 commit comments

Comments
 (0)