Skip to content

Commit 728fd5f

Browse files
author
Aaron Sierra
committed
dns: liquidweb: Implement test_create_record_success()
Leverage the existing get_record.json for this test.
1 parent b40c1c2 commit 728fd5f

1 file changed

Lines changed: 23 additions & 2 deletions

File tree

libcloud/test/dns/test_liquidweb.py

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,28 @@ def test_delete_record_RECORD_DOES_NOT_EXIST_ERROR(self):
238238
self.fail("Exception was not thrown")
239239

240240
def test_create_record_success(self):
241-
pass
241+
LiquidWebMockHttp.type = "CREATE_RECORD_SUCCESS"
242+
zone = Zone(
243+
id="13",
244+
type="master",
245+
ttl=None,
246+
domain="domain.com",
247+
extra={},
248+
driver=self.driver,
249+
)
250+
record = self.driver.create_record(
251+
name="nerd.domain.com",
252+
zone=zone,
253+
type=RecordType.A,
254+
data="127.0.0.1",
255+
extra={"ttl": 300},
256+
)
257+
258+
self.assertEqual(record.id, "13")
259+
self.assertEqual(record.type, "A")
260+
self.assertEqual(record.name, "nerd.domain.com")
261+
self.assertEqual(record.data, "127.0.0.1")
262+
self.assertEqual(record.extra.get("ttl"), 300)
242263

243264
def test_record_already_exists_error(self):
244265
pass
@@ -322,7 +343,7 @@ def _v1_Network_DNS_Record_delete_DELETE_RECORD_RECORD_DOES_NOT_EXIST(
322343
return (httplib.OK, body, {}, httplib.responses[httplib.OK])
323344

324345
def _v1_Network_DNS_Record_create_CREATE_RECORD_SUCCESS(self, method, url, body, headers):
325-
body = self.fixtures.load("")
346+
body = self.fixtures.load("get_record.json")
326347
return (httplib.OK, body, {}, httplib.responses[httplib.OK])
327348

328349
def _v1_Network_DNS_Record_ALREADY_EXISTS_ERROR(self, method, url, body, headers):

0 commit comments

Comments
 (0)