From 48254c4ed51d68408cbee5bd0cd921e2a1af1fc3 Mon Sep 17 00:00:00 2001 From: Bin Sun Date: Sun, 8 Apr 2018 17:03:34 +0800 Subject: Add fake delete server Change-Id: Iabe9ffe1c6579df83ac2096b3d6690e3102c796b Issue-ID: MULTICLOUD-199 Signed-off-by: Bin Sun --- vio/vio/tests/test_fake_nova_view.py | 10 ++++++++++ 1 file changed, 10 insertions(+) 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) -- cgit 1.2.3-korg