From: Christian Hofstaedtler Date: Mon, 28 Apr 2014 12:53:41 +0000 (+0200) Subject: API tests: rewrite test to ensure API stability X-Git-Tag: rec-3.6.0-rc1~37^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2696eea0653f151fabec6de6ecbb5451e2588651;p=thirdparty%2Fpdns.git 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. --- 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'])