]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
API tests: rewrite test to ensure API stability 1387/head
authorChristian Hofstaedtler <christian@hofstaedtler.name>
Mon, 28 Apr 2014 12:53:41 +0000 (14:53 +0200)
committerChristian Hofstaedtler <christian@hofstaedtler.name>
Mon, 28 Apr 2014 12:53:41 +0000 (14:53 +0200)
Let's test the fact that we don't need to send type/name in individual
comment entries for PATCH.

regression-tests.api/test_Zones.py

index bc2551432d4694ea8611cabb9201fe2b6f4ed097..22ac9fc7447b572e9c46c893a011be3e59836793 100644 (file)
@@ -557,9 +557,7 @@ class AuthZones(ApiTestCase):
                 {
                     'account': 'test1',
                     'content': 'oh hi there',
-                    'modified_at': 1111,
-                    'name': name,  # only for assertEquals, ignored by pdns
-                    'type': 'NS'   # only for assertEquals, ignored by pdns
+                    'modified_at': 1111
                 }
             ]
         }
@@ -595,6 +593,12 @@ class AuthZones(ApiTestCase):
         r = self.session.get(self.url("/servers/localhost/zones/" + name))
         data = r.json()
         print data
+        # fix up input data for comparison with assertEquals.
+        # the fact that we're not sending name+type is part of the API spec.
+        for c in rrset['comments']:
+            c['name'] = rrset['name']
+            c['type'] = rrset['type']
+
         self.assertEquals([r for r in data['records'] if r['type'] == 'NS'], rrset2['records'])
         self.assertEquals(data['comments'], rrset['comments'])