diff options
author | Bin Sun <bins@vmware.com> | 2018-04-11 10:35:55 +0800 |
---|---|---|
committer | Bin Sun <bins@vmware.com> | 2018-04-11 10:36:21 +0800 |
commit | b3c67a72743621523a9f2b6d1ac07237611818af (patch) | |
tree | e22124a8d6bfc0a091b9adb596f606a17f09808c /vio | |
parent | b38e8f0c4e69e45589f14968764a80a183a083da (diff) |
Add fake create heat service test
Change-Id: I83518ef30f8918e6b72739ffaa9be233545bbe5f
Issue-ID: MULTICLOUD-199
Signed-off-by: Bin Sun <bins@vmware.com>
Diffstat (limited to 'vio')
-rw-r--r-- | vio/vio/tests/test_fake_heat_view.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/vio/vio/tests/test_fake_heat_view.py b/vio/vio/tests/test_fake_heat_view.py index bca8c68..01a7568 100644 --- a/vio/vio/tests/test_fake_heat_view.py +++ b/vio/vio/tests/test_fake_heat_view.py @@ -12,6 +12,7 @@ import mock import unittest +import json from vio.swagger.views.fakeplugin.heat import views from vio.swagger.views.fakeplugin.fakeData import fakeResponse @@ -40,3 +41,22 @@ class TestFakeHeatResources(unittest.TestCase): } resp = self.view.get(req, "1234abcd", STACK_ID) self.assertEqual(200, resp.status_code) + + +class TestFakeHeatServicePreview(unittest.TestCase): + + def setUp(self): + self.view = views.FakeHeatServicePreview() + + @mock.patch.object(fakeResponse, "upload_image") + def test_create_service_preview(self, mock_createStackPreview): + req = mock.Mock() + req.META = { + "HTTP_X_AUTH_TOKEN": Token + } + req.body = json.dumps({"stack_name": STACK_NAME}) + mock_createStackPreview.return_value = { + "stack": "stack1" + } + resp = self.view.post(req, "1234abcd") + self.assertEqual(201, resp.status_code) |