@@ -23,10 +23,10 @@ def setUp(self, patched_api) -> None:
2323
2424 self ._mocked_tf_working_dir = ''
2525 self ._prepare_mock_services ()
26- self ._prepare_integration_data ()
2726
2827 self .mock_api .GetReservationDetails .return_value .ReservationDescription .Services = [self ._service1 ,
2928 self ._service2 ]
29+ self ._prepare_integration_data ()
3030
3131 def _prepare_integration_data (self ):
3232 self .integration_data1 = IntegrationData (self ._service1 .Alias , False , self .mock_api )
@@ -62,6 +62,11 @@ def run_destroy(self, pre_destroy_function: Callable, integration_data: Integrat
6262 self .pre_destroy_prep (pre_destroy_function , integration_data )
6363 integration_data .tf_shell .destroy_terraform ()
6464
65+ def run_execute_and_destroy (self , pre_exec_function : Callable , pre_destroy_function : Callable ,
66+ integration_data : IntegrationData ):
67+ self .run_execute (pre_exec_function , integration_data )
68+ self .run_destroy (pre_destroy_function , integration_data )
69+
6570 '''------------------------------ Test Cases ---------------------------------'''
6671
6772 @patch ('cloudshell.iac.terraform.services.tf_proc_exec.TfProcExec.can_destroy_run' )
@@ -122,6 +127,9 @@ def pre_exec_azure_vault(self, integration_data: IntegrationData):
122127 os .environ .get ("CLP_RESOURSE" ),
123128 integration_data
124129 )
130+ self ._prepare_service1_before_execute (integration_data )
131+
132+ def _prepare_service1_before_execute (self , integration_data ):
125133 service1 = Mock ()
126134 service1 .Alias = integration_data .context .resource .name
127135 service1 .Attributes = integration_data .context .resource .attributes
@@ -144,6 +152,7 @@ def pre_exec_azure_mssql(self, integration_data: IntegrationData):
144152 os .environ .get ("" ),
145153 integration_data
146154 )
155+ self ._prepare_service1_before_execute (integration_data )
147156
148157 def pre_exec_azure_vault_with_remote_access_key_based (self , integration_data : IntegrationData ):
149158 self .pre_exec_azure_vault (integration_data )
0 commit comments