libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthonys...@apache.org
Subject [1/4] libcloud git commit: create tests to validate LIBCLOUD-875
Date Sun, 20 Aug 2017 23:32:07 GMT
Repository: libcloud
Updated Branches:
  refs/heads/trunk 95b087fd4 -> f5e11c5f4


create tests to validate LIBCLOUD-875


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

Branch: refs/heads/trunk
Commit: b3b5086d19baa585af4987b0e32e7fdbe595ea5a
Parents: 95b087f
Author: Anthony Shaw <anthonyshaw@apache.org>
Authored: Mon Aug 21 08:55:16 2017 +1000
Committer: Anthony Shaw <anthonyshaw@apache.org>
Committed: Mon Aug 21 08:55:16 2017 +1000

----------------------------------------------------------------------
 libcloud/test/dns/test_route53.py | 60 ++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/b3b5086d/libcloud/test/dns/test_route53.py
----------------------------------------------------------------------
diff --git a/libcloud/test/dns/test_route53.py b/libcloud/test/dns/test_route53.py
index 1692f22..315ea23 100644
--- a/libcloud/test/dns/test_route53.py
+++ b/libcloud/test/dns/test_route53.py
@@ -168,6 +168,66 @@ class Route53Tests(unittest.TestCase):
         self.assertEqual(record.type, RecordType.A)
         self.assertEqual(record.data, '127.0.0.1')
 
+    def test_create_TXT_record(self):
+        """
+        Check that TXT records are created in quotes
+        """
+        zone = self.driver.list_zones()[0]
+        record = self.driver.create_record(
+            name='', zone=zone,
+            type=RecordType.TXT, data='test'
+        )
+        self.assertEqual(record.id, 'TXT:')
+        self.assertEqual(record.name, '')
+        self.assertEqual(record.zone, zone)
+        self.assertEqual(record.type, RecordType.TXT)
+        self.assertEqual(record.data, '"test"')
+
+    def test_create_TXT_record_quoted(self):
+        """
+        Check that TXT values already quoted are not changed
+        """
+        zone = self.driver.list_zones()[0]
+        record = self.driver.create_record(
+            name='', zone=zone,
+            type=RecordType.TXT, data='"test"'
+        )
+        self.assertEqual(record.id, 'TXT:')
+        self.assertEqual(record.name, '')
+        self.assertEqual(record.zone, zone)
+        self.assertEqual(record.type, RecordType.TXT)
+        self.assertEqual(record.data, '"test"')
+
+    def test_create_SPF_record(self):
+        """
+        Check that SPF records are created in quotes
+        """
+        zone = self.driver.list_zones()[0]
+        record = self.driver.create_record(
+            name='', zone=zone,
+            type=RecordType.SPF, data='test'
+        )
+        self.assertEqual(record.id, 'SPF:')
+        self.assertEqual(record.name, '')
+        self.assertEqual(record.zone, zone)
+        self.assertEqual(record.type, RecordType.SPF)
+        self.assertEqual(record.data, '"test"')
+
+    def test_create_SPF_record_quoted(self):
+        """
+        Check that SPF values already quoted are not changed
+        """
+        zone = self.driver.list_zones()[0]
+        record = self.driver.create_record(
+            name='', zone=zone,
+            type=RecordType.SPF, data='"test"'
+        )
+        self.assertEqual(record.id, 'SPF:')
+        self.assertEqual(record.name, '')
+        self.assertEqual(record.zone, zone)
+        self.assertEqual(record.type, RecordType.SPF)
+        self.assertEqual(record.data, '"test"')
+
     def test_create_multi_value_record(self):
         zone = self.driver.list_zones()[0]
         records = self.driver.ex_create_multi_value_record(


Mime
View raw message