From 00a9b2299001f4c74c2e1877b902e4fd7bc75b26 Mon Sep 17 00:00:00 2001 From: Christian Hofstaedtler Date: Tue, 28 Jan 2014 09:43:37 +0100 Subject: [PATCH] webserver: add (failing) test: zone create with slash --- regression-tests.api/test_Zones.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/regression-tests.api/test_Zones.py b/regression-tests.api/test_Zones.py index 42e09f57a..fc438f159 100644 --- a/regression-tests.api/test_Zones.py +++ b/regression-tests.api/test_Zones.py @@ -33,6 +33,27 @@ class Servers(ApiTestCase): if k in payload: self.assertEquals(data[k], payload[k]) + @unittest.expectedFailure + def test_CreateZoneWithSymbols(self): + payload = { + 'name': 'foo/bar.'+unique_zone_name(), + 'kind': 'Native', + 'nameservers': ['ns1.foo.com', 'ns2.foo.com'] + } + expected_id = payload['name'] + expected_id.replace('/', '\047') + r = self.session.post( + self.url("/servers/localhost/zones"), + data=json.dumps(payload), + headers={'content-type': 'application/json'}) + self.assertSuccessJson(r) + data = r.json() + for k in ('id', 'url', 'name', 'masters', 'kind', 'last_check', 'notified_serial', 'serial'): + self.assertIn(k, data) + if k in payload: + self.assertEquals(data[k], payload[k]) + self.assertEquals(data[k], expected_id) + def test_GetZone(self): r = self.session.get(self.url("/servers/localhost/zones")) domains = r.json() -- 2.40.0