Merge "Get on an abandon zone returns 405"
This commit is contained in:
commit
54726e9e36
@ -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)
|
||||
|
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user