summaryrefslogtreecommitdiffstats
path: root/vio
diff options
context:
space:
mode:
authorEthan Lynn <ethanlynnl@vmware.com>2018-06-13 15:24:32 +0800
committerEthan Lynn <ethanlynnl@vmware.com>2018-06-13 15:25:12 +0800
commiteeb0fb958aeaa10e1fcfcaf2453534c303c28d48 (patch)
treee6e2dd44e8565fa195f40c7c30ab9cb6a5ae401a /vio
parent95616621e4b0e1bd65f5a3f1f0412c859105c6a5 (diff)
Add test_list_stacks
Add test_list_stacks Change-Id: Ie4499e41b90b2874a86eddab55fa015ea82cd5fd Issue-ID: MULTICLOUD-199 Signed-off-by: Ethan Lynn <ethanlynnl@vmware.com>
Diffstat (limited to 'vio')
-rw-r--r--vio/vio/tests/test_fake_heat_view.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/vio/vio/tests/test_fake_heat_view.py b/vio/vio/tests/test_fake_heat_view.py
index 3cdb41a..5e87a61 100644
--- a/vio/vio/tests/test_fake_heat_view.py
+++ b/vio/vio/tests/test_fake_heat_view.py
@@ -67,18 +67,23 @@ class TestFakeHeatService(unittest.TestCase):
def setUp(self):
self.view = views.FakeHeatService()
- @mock.patch.object(fakeResponse, "getAllStacks")
- def test_get_heat_stacks(self, mock_getAllStacks):
+ def test_get_heat_stack(self):
req = mock.Mock()
req.META = {
"HTTP_X_AUTH_TOKEN": Token
}
- mock_getAllStacks.return_value = {
- "stack": "1234abcd"
- }
resp = self.view.get(req, "1234abcd", STACK_NAME, STACK_ID)
self.assertEqual(200, resp.status_code)
+ def test_list_stacks(self):
+ req = mock.Mock()
+ req.META = {
+ "HTTP_X_AUTH_TOKEN": Token
+ }
+ resp = self.view.get(req, "1234abcd")
+ self.assertEqual(200, resp.status_code)
+ self.assertEqual(1, len(resp.data['stacks']))
+
@mock.patch.object(fakeResponse, "createStack")
def test_create_service_preview(self, mock_createStack):
req = mock.Mock()