summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBin Sun <bins@vmware.com>2018-04-08 17:03:34 +0800
committerBin Sun <bins@vmware.com>2018-04-08 17:03:58 +0800
commit48254c4ed51d68408cbee5bd0cd921e2a1af1fc3 (patch)
treef9db2189e3c934eb04bd38050d565f6fd3aa92ef
parent63a4f2fd7a6cb79096a44cf86cdd9a9ac2d551c7 (diff)
Add fake delete server
Change-Id: Iabe9ffe1c6579df83ac2096b3d6690e3102c796b Issue-ID: MULTICLOUD-199 Signed-off-by: Bin Sun <bins@vmware.com>
-rw-r--r--vio/vio/tests/test_fake_nova_view.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/vio/vio/tests/test_fake_nova_view.py b/vio/vio/tests/test_fake_nova_view.py
index 8e3fdab..89e1bc8 100644
--- a/vio/vio/tests/test_fake_nova_view.py
+++ b/vio/vio/tests/test_fake_nova_view.py
@@ -40,3 +40,13 @@ class TestFakeNovaServer(unittest.TestCase):
}
resp = self.view.get(req, "abcd", Server)
self.assertEqual(200, resp.status_code)
+
+ @mock.patch.object(fakeResponse, "delete_server")
+ def test_delete_server(self, mock_delete_server):
+ req = mock.Mock()
+ req.META = {
+ "HTTP_X_AUTH_TOKEN": Token
+ }
+ mock_delete_server.return_value = {}
+ resp = self.view.delete(req, "abcd", Server)
+ self.assertEqual(204, resp.status_code)