diff options
author | Sean Dague <sean@dague.net> | 2014-11-07 14:27:03 +0100 |
---|---|---|
committer | Sean Dague <sean@dague.net> | 2014-11-12 15:31:08 -0500 |
commit | 89cd6a0c493e26b5a9e017c99d731464292abbaf (patch) | |
tree | c2bf790d1684cd539b820247113492495123a163 /nova/tests/unit/integrated/v3/test_deferred_delete.py | |
parent | 5c8bbaafef590e4d346a03051a0ba55c8be26c5c (diff) | |
download | nova-89cd6a0c493e26b5a9e017c99d731464292abbaf.tar.gz |
move all tests to nova/tests/unit
As part of the split of functional and unit tests we need to isolate
the unit tests into a separate directory for having multiple test
targets in a sane way.
Part of bp:functional-tests-for-nova
Change-Id: Id42ba373c1bda6a312b673ab2b489ca56da8c628
Diffstat (limited to 'nova/tests/unit/integrated/v3/test_deferred_delete.py')
-rw-r--r-- | nova/tests/unit/integrated/v3/test_deferred_delete.py | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/nova/tests/unit/integrated/v3/test_deferred_delete.py b/nova/tests/unit/integrated/v3/test_deferred_delete.py new file mode 100644 index 0000000000..0b8d970900 --- /dev/null +++ b/nova/tests/unit/integrated/v3/test_deferred_delete.py @@ -0,0 +1,42 @@ +# Copyright 2012 Nebula, Inc. +# Copyright 2013 IBM Corp. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from nova.tests.unit.integrated.v3 import test_servers + + +class DeferredDeleteSampleJsonTests(test_servers.ServersSampleBase): + extension_name = "os-deferred-delete" + + def setUp(self): + super(DeferredDeleteSampleJsonTests, self).setUp() + self.flags(reclaim_instance_interval=1) + + def test_restore(self): + uuid = self._post_server() + response = self._do_delete('servers/%s' % uuid) + + response = self._do_post('servers/%s/action' % uuid, + 'restore-post-req', {}) + self.assertEqual(response.status_code, 202) + self.assertEqual(response.content, '') + + def test_force_delete(self): + uuid = self._post_server() + response = self._do_delete('servers/%s' % uuid) + + response = self._do_post('servers/%s/action' % uuid, + 'force-delete-post-req', {}) + self.assertEqual(response.status_code, 202) + self.assertEqual(response.content, '') |