diff options
author | Ethan Lynn <ethanlynnl@vmware.com> | 2018-06-13 14:58:58 +0800 |
---|---|---|
committer | Ethan Lynn <ethanlynnl@vmware.com> | 2018-06-13 14:58:58 +0800 |
commit | 2b77de166471325e417d0f46375a3f2faae0898c (patch) | |
tree | e3ba03e41a6e3d0efcc6dab00ff3a5038770d2c9 | |
parent | 2482b242b5664e68a5d1f6f04b69c93ad7022681 (diff) |
Add test_operate_server_start
Add test_operate_server_start
Change-Id: Ie42f2c2a13e2fa7e5c8116e2a8ae070941e0e35b
Issue-ID: MULTICLOUD-199
Signed-off-by: Ethan Lynn <ethanlynnl@vmware.com>
-rw-r--r-- | vio/vio/tests/test_fake_nova_view.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/vio/vio/tests/test_fake_nova_view.py b/vio/vio/tests/test_fake_nova_view.py index feab23b..35ff922 100644 --- a/vio/vio/tests/test_fake_nova_view.py +++ b/vio/vio/tests/test_fake_nova_view.py @@ -84,6 +84,20 @@ class TestFakeNovaServer(unittest.TestCase): self.assertEqual( "POWERING_OFF", fakeResponse.serverMapps[Server]['status']) + def test_operate_server_start(self): + req = mock.Mock() + req.META = { + "HTTP_X_AUTH_TOKEN": Token + } + req.body = json.dumps({ + "os-start": {} + }) + fakeResponse.serverMapps[Server]['status'] = "SHUTDOWN" + resp = self.view.post(req, "abcd", Server) + self.assertEqual(202, resp.status_code) + self.assertEqual( + "POWERING_ON", fakeResponse.serverMapps[Server]['status']) + class TestFakeNovaHypervisors(unittest.TestCase): |