From 0f79633c71e23b08e6fc8cf75fd67548e2942268 Mon Sep 17 00:00:00 2001 From: Ethan Lynn Date: Wed, 13 Jun 2018 15:04:52 +0800 Subject: Add test_operate_server_unsupport Add test_operate_server_unsupport Change-Id: Iad681f11ccd75b950fa6c650d9308ac026fc9965 Issue-ID: MULTICLOUD-199 Signed-off-by: Ethan Lynn --- vio/vio/tests/test_fake_nova_view.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/vio/vio/tests/test_fake_nova_view.py b/vio/vio/tests/test_fake_nova_view.py index e126e32..40278e5 100644 --- a/vio/vio/tests/test_fake_nova_view.py +++ b/vio/vio/tests/test_fake_nova_view.py @@ -152,6 +152,17 @@ class TestFakeNovaServer(unittest.TestCase): self.assertEqual( "REBOOTING", fakeResponse.serverMapps[Server]['status']) + def test_operate_server_unsupport(self): + req = mock.Mock() + req.META = { + "HTTP_X_AUTH_TOKEN": Token + } + req.body = json.dumps({ + "invalid": {} + }) + resp = self.view.post(req, "abcd", Server) + self.assertEqual(405, resp.status_code) + class TestFakeNovaHypervisors(unittest.TestCase): -- cgit 1.2.3-korg