X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=yardstick%2FvTC%2Fapexlake%2Ftests%2Fdeployment_unit_test.py;h=1ff4225d6967a6ccef51d65d4b8ee5b0cdbad5a6;hb=c1a4f5028f88e7e97e3ae2cc3f8aae6bf67c07b2;hp=5a9178f5378f59a2c492ec0d16f0fcb1a5b8a0d0;hpb=f036e9898a69f5041f9cde02e3652c29e2de1643;p=yardstick.git diff --git a/yardstick/vTC/apexlake/tests/deployment_unit_test.py b/yardstick/vTC/apexlake/tests/deployment_unit_test.py index 5a9178f53..1ff4225d6 100644 --- a/yardstick/vTC/apexlake/tests/deployment_unit_test.py +++ b/yardstick/vTC/apexlake/tests/deployment_unit_test.py @@ -130,6 +130,7 @@ class DummyDeploymentUnit(mut.DeploymentUnit): raise Exception +@mock.patch("experimental_framework.deployment_unit.time") class TestDeploymentUnit(unittest.TestCase): def setUp(self): @@ -140,7 +141,7 @@ class TestDeploymentUnit(unittest.TestCase): @mock.patch('experimental_framework.heat_manager.HeatManager', side_effect=DummyHeatManager) - def test_constructor_for_sanity(self, mock_heat_manager): + def test_constructor_for_sanity(self, mock_heat_manager, mock_time): du = mut.DeploymentUnit(dict()) self.assertTrue(isinstance(du.heat_manager, DummyHeatManager)) mock_heat_manager.assert_called_once_with(dict()) @@ -150,7 +151,7 @@ class TestDeploymentUnit(unittest.TestCase): side_effect=DummyHeatManager) @mock.patch('os.path.isfile') def test_deploy_heat_template_for_failure(self, mock_os_is_file, - mock_heat_manager): + mock_heat_manager, mock_time): mock_os_is_file.return_value = False du = mut.DeploymentUnit(dict()) template_file = '' @@ -163,7 +164,7 @@ class TestDeploymentUnit(unittest.TestCase): side_effect=DummyHeatManager) @mock.patch('os.path.isfile') def test_deploy_heat_template_for_success(self, mock_os_is_file, - mock_heat_manager): + mock_heat_manager, mock_time): mock_os_is_file.return_value = True du = mut.DeploymentUnit(dict()) template_file = '' @@ -178,7 +179,7 @@ class TestDeploymentUnit(unittest.TestCase): side_effect=DummyHeatManagerComplete) @mock.patch('os.path.isfile') def test_deploy_heat_template_2_for_success(self, mock_os_is_file, - mock_heat_manager): + mock_heat_manager, mock_time): mock_os_is_file.return_value = True du = mut.DeploymentUnit(dict()) template_file = '' @@ -196,7 +197,7 @@ class TestDeploymentUnit(unittest.TestCase): side_effect=DummyDeploymentUnit) def test_deploy_heat_template_3_for_success(self, mock_dep_unit, mock_os_is_file, - mock_heat_manager): + mock_heat_manager, mock_time): mock_os_is_file.return_value = True du = mut.DeploymentUnit(dict()) template_file = '' @@ -212,7 +213,7 @@ class TestDeploymentUnit(unittest.TestCase): side_effect=DummyHeatManagerFailed) @mock.patch('os.path.isfile') def test_deploy_heat_template_for_success_2(self, mock_os_is_file, - mock_heat_manager, mock_log): + mock_heat_manager, mock_log, mock_time): mock_os_is_file.return_value = True du = DummyDeploymentUnit(dict()) template_file = '' @@ -226,7 +227,7 @@ class TestDeploymentUnit(unittest.TestCase): side_effect=DummyHeatManagerDestroy) @mock.patch('experimental_framework.common.LOG') def test_destroy_heat_template_for_success(self, mock_log, - mock_heat_manager): + mock_heat_manager, mock_time): openstack_credentials = dict() du = mut.DeploymentUnit(openstack_credentials) du.deployed_stacks = ['stack'] @@ -238,14 +239,14 @@ class TestDeploymentUnit(unittest.TestCase): side_effect=DummyHeatManagerDestroyException) @mock.patch('experimental_framework.common.LOG') def test_destroy_heat_template_for_success_2(self, mock_log, - mock_heat_manager): + mock_heat_manager, mock_time): openstack_credentials = dict() du = mut.DeploymentUnit(openstack_credentials) du.deployed_stacks = ['stack'] stack_name = 'stack' self.assertFalse(du.destroy_heat_template(stack_name)) - def test_destroy_all_deployed_stacks_for_success(self): + def test_destroy_all_deployed_stacks_for_success(self, mock_time): du = DeploymentUnitDestroy() du.destroy_all_deployed_stacks() self.assertTrue(du.destroy_heat_template()) @@ -254,7 +255,7 @@ class TestDeploymentUnit(unittest.TestCase): side_effect=DummyHeatManagerReiteration) @mock.patch('os.path.isfile') def test_deploy_heat_template_for_success_3(self, mock_os_is_file, - mock_heat_manager): + mock_heat_manager, mock_time): mock_os_is_file.return_value = True du = mut.DeploymentUnit(dict()) template = 'template_reiteration'