# See the License for the specific language governing permissions and
# limitations under the License.
# See the License for the specific language governing permissions and
# limitations under the License.
@mock.patch('experimental_framework.heat_manager.HeatManager',
side_effect=DummyHeatManager)
@mock.patch('experimental_framework.heat_manager.HeatManager',
side_effect=DummyHeatManager)
du = mut.DeploymentUnit(dict())
self.assertTrue(isinstance(du.heat_manager, DummyHeatManager))
mock_heat_manager.assert_called_once_with(dict())
du = mut.DeploymentUnit(dict())
self.assertTrue(isinstance(du.heat_manager, DummyHeatManager))
mock_heat_manager.assert_called_once_with(dict())
side_effect=DummyHeatManager)
@mock.patch('os.path.isfile')
def test_deploy_heat_template_for_failure(self, mock_os_is_file,
side_effect=DummyHeatManager)
@mock.patch('os.path.isfile')
def test_deploy_heat_template_for_failure(self, mock_os_is_file,
side_effect=DummyHeatManager)
@mock.patch('os.path.isfile')
def test_deploy_heat_template_for_success(self, mock_os_is_file,
side_effect=DummyHeatManager)
@mock.patch('os.path.isfile')
def test_deploy_heat_template_for_success(self, mock_os_is_file,
side_effect=DummyHeatManagerComplete)
@mock.patch('os.path.isfile')
def test_deploy_heat_template_2_for_success(self, mock_os_is_file,
side_effect=DummyHeatManagerComplete)
@mock.patch('os.path.isfile')
def test_deploy_heat_template_2_for_success(self, mock_os_is_file,
side_effect=DummyDeploymentUnit)
def test_deploy_heat_template_3_for_success(self, mock_dep_unit,
mock_os_is_file,
side_effect=DummyDeploymentUnit)
def test_deploy_heat_template_3_for_success(self, mock_dep_unit,
mock_os_is_file,
side_effect=DummyHeatManagerFailed)
@mock.patch('os.path.isfile')
def test_deploy_heat_template_for_success_2(self, mock_os_is_file,
side_effect=DummyHeatManagerFailed)
@mock.patch('os.path.isfile')
def test_deploy_heat_template_for_success_2(self, mock_os_is_file,
side_effect=DummyHeatManagerDestroy)
@mock.patch('experimental_framework.common.LOG')
def test_destroy_heat_template_for_success(self, mock_log,
side_effect=DummyHeatManagerDestroy)
@mock.patch('experimental_framework.common.LOG')
def test_destroy_heat_template_for_success(self, mock_log,
openstack_credentials = dict()
du = mut.DeploymentUnit(openstack_credentials)
du.deployed_stacks = ['stack']
openstack_credentials = dict()
du = mut.DeploymentUnit(openstack_credentials)
du.deployed_stacks = ['stack']
side_effect=DummyHeatManagerDestroyException)
@mock.patch('experimental_framework.common.LOG')
def test_destroy_heat_template_for_success_2(self, mock_log,
side_effect=DummyHeatManagerDestroyException)
@mock.patch('experimental_framework.common.LOG')
def test_destroy_heat_template_for_success_2(self, mock_log,
openstack_credentials = dict()
du = mut.DeploymentUnit(openstack_credentials)
du.deployed_stacks = ['stack']
stack_name = 'stack'
self.assertFalse(du.destroy_heat_template(stack_name))
openstack_credentials = dict()
du = mut.DeploymentUnit(openstack_credentials)
du.deployed_stacks = ['stack']
stack_name = 'stack'
self.assertFalse(du.destroy_heat_template(stack_name))
du = DeploymentUnitDestroy()
du.destroy_all_deployed_stacks()
self.assertTrue(du.destroy_heat_template())
du = DeploymentUnitDestroy()
du.destroy_all_deployed_stacks()
self.assertTrue(du.destroy_heat_template())
side_effect=DummyHeatManagerReiteration)
@mock.patch('os.path.isfile')
def test_deploy_heat_template_for_success_3(self, mock_os_is_file,
side_effect=DummyHeatManagerReiteration)
@mock.patch('os.path.isfile')
def test_deploy_heat_template_for_success_3(self, mock_os_is_file,
mock_os_is_file.return_value = True
du = mut.DeploymentUnit(dict())
template = 'template_reiteration'
mock_os_is_file.return_value = True
du = mut.DeploymentUnit(dict())
template = 'template_reiteration'