summaryrefslogtreecommitdiffstats
path: root/vio
diff options
context:
space:
mode:
authorBin Sun <bins@vmware.com>2018-04-09 10:14:04 +0800
committerBin Sun <bins@vmware.com>2018-04-09 10:14:31 +0800
commit5f4eafec37170f835fbe5c3124197f8eb6cae724 (patch)
tree8e7f0149e3dbb0686f8f0f2e20460818d8508cfb /vio
parente952112fec17050820346cb8413f36db04f63dfb (diff)
Add fake get server detail test
Change-Id: Ibf00156a23cc7614858c6e0eff6754c3b7e7e85c Issue-ID: MULTICLOUD-199 Signed-off-by: Bin Sun <bins@vmware.com>
Diffstat (limited to 'vio')
-rw-r--r--vio/vio/tests/test_fake_nova_view.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/vio/vio/tests/test_fake_nova_view.py b/vio/vio/tests/test_fake_nova_view.py
index cb63e56..fc5b01f 100644
--- a/vio/vio/tests/test_fake_nova_view.py
+++ b/vio/vio/tests/test_fake_nova_view.py
@@ -86,3 +86,21 @@ class TestFakeNovaAggregate(unittest.TestCase):
}
resp = self.view.get(req, "abcd")
self.assertEqual(200, resp.status_code)
+
+
+class TestFakeNovaServerDetail(unittest.TestCase):
+
+ def setUp(self):
+ self.view = views.FakeNovaServerDetail()
+
+ @mock.patch.object(fakeResponse, "get_serverdetail")
+ def test_get_server(self, mock_get_serverdetail):
+ req = mock.Mock()
+ req.META = {
+ "HTTP_X_AUTH_TOKEN": Token
+ }
+ mock_get_serverdetail.return_value = {
+ "servers": "1234abcd"
+ }
+ resp = self.view.get(req, "abcd")
+ self.assertEqual(200, resp.status_code)