aboutsummaryrefslogtreecommitdiffstats
path: root/tests/spawn_vm_test.py
diff options
context:
space:
mode:
authorwu.zhihui <wu.zhihui1@zte.com.cn>2016-09-23 16:53:55 +0800
committerwu.zhihui <wu.zhihui1@zte.com.cn>2016-09-27 11:20:11 +0800
commit1a2b55736da4d18758f81444933181e380202f60 (patch)
treeb6c0dec37b7989456feb82485aed629333e9af36 /tests/spawn_vm_test.py
parent58ac79cd54821bf8c3891d136be4254aa79bfa08 (diff)
code refactor: run_qtip.sh
1. Add prepare_qtip_image.sh to prepare qtip image before qtip test. 2. Add cleanup_qtip_image.sh to clean up qtip image after finishing qtip test. Both of them are invoked in run_qtip.sh Change-Id: Iba892a2e02e31820ed0525f80a4e2885899557e0 Signed-off-by: wu.zhihui <wu.zhihui1@zte.com.cn>
Diffstat (limited to 'tests/spawn_vm_test.py')
-rw-r--r--tests/spawn_vm_test.py13
1 files changed, 1 insertions, 12 deletions
diff --git a/tests/spawn_vm_test.py b/tests/spawn_vm_test.py
index eb843ad9..b22745d7 100644
--- a/tests/spawn_vm_test.py
+++ b/tests/spawn_vm_test.py
@@ -10,15 +10,6 @@ class KeystoneMock(MagicMock):
v2_0 = Mock()
-class ImageMock(MagicMock):
- name = 'QTIP_CentOS'
-
-
-class ImagesMock(MagicMock):
- def list(self):
- return [ImageMock()]
-
-
class StackMock(MagicMock):
status = 'COMPLETE'
outputs = [{'output_key': 'availability_instance_1',
@@ -55,13 +46,11 @@ class TestClass:
@mock.patch('func.spawn_vm.FetchImg')
@mock.patch('func.spawn_vm.create_zones')
@mock.patch('func.spawn_vm.client', autospec=True)
- @mock.patch('func.spawn_vm.glanceclient', autospec=True)
@mock.patch('func.spawn_vm.keystoneclient.v2_0', autospec=True)
@mock.patch('func.spawn_vm.heatclient.client', autospec=True)
- def test_create_zones_success(self, mock_heat, mock_keystone, mock_glance,
+ def test_create_zones_success(self, mock_heat, mock_keystone,
mock_nova_client, mock_zone, mock_fetch,
mock_setup, test_input, expected):
- mock_glance.Client.return_value = Mock(images=ImagesMock())
mock_nova_client.Client.return_value = Mock()
mock_heat.Client.return_value = Mock(stacks=HeatMock())
k = mock.patch.dict(os.environ, {'INSTALLER_TYPE': 'fuel'})