From 2696eea0653f151fabec6de6ecbb5451e2588651 Mon Sep 17 00:00:00 2001 From: Christian Hofstaedtler Date: Mon, 28 Apr 2014 14:53:41 +0200 Subject: [PATCH] API tests: rewrite test to ensure API stability 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 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/regression-tests.api/test_Zones.py b/regression-tests.api/test_Zones.py index bc2551432d..22ac9fc744 100644 --- a/regression-tests.api/test_Zones.py +++ b/regression-tests.api/test_Zones.py @@ -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']) -- 2.47.2