diff --git a/designate/api/v2/controllers/zones/tasks/abandon.py b/designate/api/v2/controllers/zones/tasks/abandon.py index 3a33ac596..935678ac2 100644 --- a/designate/api/v2/controllers/zones/tasks/abandon.py +++ b/designate/api/v2/controllers/zones/tasks/abandon.py @@ -38,3 +38,8 @@ class AbandonController(rest.RestController): # NOTE: This is a hack and a half.. But Pecan needs it. return '' + + @pecan.expose(template='json:', content_type='application/json') + @utils.validate_uuid('zone_id') + def get_all(self, zone_id, **params): + pecan.abort(405) diff --git a/designate/tests/test_api/test_v2/test_zones.py b/designate/tests/test_api/test_v2/test_zones.py index 818f970a5..a5f8b626c 100644 --- a/designate/tests/test_api/test_v2/test_zones.py +++ b/designate/tests/test_api/test_v2/test_zones.py @@ -361,7 +361,7 @@ class ApiV2ZonesTest(ApiV2TestCase): self._assert_exception('domain_not_found', 404, self.client.delete, url) - def test_abandon_zone(self): + def test_post_abandon_zone(self): zone = self.create_domain() url = '/zones/%s/tasks/abandon' % zone.id @@ -373,6 +373,22 @@ class ApiV2ZonesTest(ApiV2TestCase): response = self.client.post_json(url) self.assertEqual(204, response.status_int) + def test_get_abandon_zone(self): + zone = self.create_domain() + url = '/zones/%s/tasks/abandon' % zone.id + self._assert_exception('method_not_allowed', 405, self.client.get, url) + + def test_get_invalid_abandon(self): + # This is an invalid endpoint - should return 404 + url = '/zones/tasks/abandon' + self._assert_exception('not_found', 404, self.client.get, url) + + def test_get_zone_tasks(self): + # This is an invalid endpoint - should return 404 + zone = self.create_domain() + url = '/zones/%s/tasks' % zone.id + self._assert_exception('not_found', 404, self.client.get, url) + # Zone import/export def test_missing_origin(self): fixture = self.get_zonefile_fixture(variant='noorigin')