diff options
author | Ethan Lynn <ethanlynnl@vmware.com> | 2018-06-13 15:01:50 +0800 |
---|---|---|
committer | Ethan Lynn <ethanlynnl@vmware.com> | 2018-06-13 15:01:50 +0800 |
commit | 5019c376469ee09f09f36c82c444ee95734729bf (patch) | |
tree | 237149537cc1d2ba32846c7ad8da741beb690509 | |
parent | 7332806d416bfac209fdda72854533f3e5489de8 (diff) |
Add test_operate_server_suspend
Add test_operate_server_suspend
Change-Id: I99658e3712b4870a975050a436e091ac6e2b90ec
Issue-ID: MULTICLOUD-199
Signed-off-by: Ethan Lynn <ethanlynnl@vmware.com>
-rw-r--r-- | vio/vio/tests/test_fake_nova_view.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/vio/vio/tests/test_fake_nova_view.py b/vio/vio/tests/test_fake_nova_view.py index 3d322cd..daa753e 100644 --- a/vio/vio/tests/test_fake_nova_view.py +++ b/vio/vio/tests/test_fake_nova_view.py @@ -112,6 +112,19 @@ class TestFakeNovaServer(unittest.TestCase): self.assertEqual( "ACTIVE", fakeResponse.serverMapps[Server]['status']) + def test_operate_server_suspend(self): + req = mock.Mock() + req.META = { + "HTTP_X_AUTH_TOKEN": Token + } + req.body = json.dumps({ + "suspend": {} + }) + resp = self.view.post(req, "abcd", Server) + self.assertEqual(202, resp.status_code) + self.assertEqual( + "SUSPENDED", fakeResponse.serverMapps[Server]['status']) + class TestFakeNovaHypervisors(unittest.TestCase): |