libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject [4/5] libcloud git commit: Add a test case for it.
Date Tue, 01 Mar 2016 15:26:44 GMT
Add a test case for it.

Closes #718


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/bd3c1f04
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/bd3c1f04
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/bd3c1f04

Branch: refs/heads/trunk
Commit: bd3c1f044cb59333e3c6bd20cc6bff4db1428316
Parents: 2929692
Author: Tomaz Muraus <tomaz@apache.org>
Authored: Tue Mar 1 15:59:44 2016 +0100
Committer: Tomaz Muraus <tomaz@apache.org>
Committed: Tue Mar 1 16:01:24 2016 +0100

----------------------------------------------------------------------
 .../test/dns/fixtures/gandi/list_records.xml    | 26 ++++++++++++++++++++
 libcloud/test/dns/test_gandi.py                 | 10 +++++++-
 2 files changed, 35 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/bd3c1f04/libcloud/test/dns/fixtures/gandi/list_records.xml
----------------------------------------------------------------------
diff --git a/libcloud/test/dns/fixtures/gandi/list_records.xml b/libcloud/test/dns/fixtures/gandi/list_records.xml
index e91c565..2499036 100644
--- a/libcloud/test/dns/fixtures/gandi/list_records.xml
+++ b/libcloud/test/dns/fixtures/gandi/list_records.xml
@@ -78,7 +78,33 @@
                            <value><string>208.111.35.173</string></value>
                         </member>
                      </struct>
+                 </value>
+
+                  <value>
+                     <struct>
+                        <member>
+                           <name>id</name>
+                           <value><int>47234</int></value>
+                        </member>
+                        <member>
+                           <name>name</name>
+                           <value><string></string></value>
+                        </member>
+                        <member>
+                           <name>ttl</name>
+                           <value><int>86400</int></value>
+                        </member>
+                        <member>
+                           <name>type</name>
+                           <value><string>MX</string></value>
+                        </member>
+                        <member>
+                           <name>value</name>
+                           <value><string>15 aspmx.l.google.com</string></value>
+                        </member>
+                     </struct>
                   </value>
+
                </data>
             </array>
          </value>

http://git-wip-us.apache.org/repos/asf/libcloud/blob/bd3c1f04/libcloud/test/dns/test_gandi.py
----------------------------------------------------------------------
diff --git a/libcloud/test/dns/test_gandi.py b/libcloud/test/dns/test_gandi.py
index 0406077..4c3d6b6 100644
--- a/libcloud/test/dns/test_gandi.py
+++ b/libcloud/test/dns/test_gandi.py
@@ -50,7 +50,7 @@ class GandiTests(unittest.TestCase):
     def test_list_records(self):
         zone = self.driver.list_zones()[0]
         records = self.driver.list_records(zone=zone)
-        self.assertEqual(len(records), 3)
+        self.assertEqual(len(records), 4)
 
         record = records[1]
         self.assertEqual(record.name, 'www')
@@ -58,6 +58,14 @@ class GandiTests(unittest.TestCase):
         self.assertEqual(record.type, RecordType.A)
         self.assertEqual(record.data, '208.111.35.173')
 
+        record = records[3]
+        self.assertEqual(record.name, '')
+        self.assertEqual(record.id, 'MX:')
+        self.assertEqual(record.type, RecordType.MX)
+        self.assertEqual(record.data, 'aspmx.l.google.com')
+        self.assertEqual(record.extra['priority'], 15)
+        self.assertEqual(record.extra['ttl'], 86400)
+
     def test_get_zone(self):
         zone = self.driver.get_zone(zone_id='47234')
         self.assertEqual(zone.id, '47234')


Mime
View raw message