18
18
Variables ,
19
19
)
20
20
from tests .unit .infrablocks .invoke_terraform .test_support import (
21
- TerraformFactory ,
21
+ MockTerraformFactory ,
22
22
)
23
23
24
24
@@ -132,7 +132,7 @@ def test_adds_both_all_and_plan_parameters_to_plan_task(self):
132
132
def test_plan_does_not_use_workspace_when_not_set (self ):
133
133
terraform = Mock (spec = Terraform )
134
134
task_factory = TaskFactory (
135
- terraform_factory = TerraformFactory (terraform )
135
+ terraform_factory = MockTerraformFactory (terraform )
136
136
)
137
137
138
138
def pre_task_function (_context , _ , configuration : Configuration ):
@@ -149,7 +149,7 @@ def pre_task_function(_context, _, configuration: Configuration):
149
149
def test_plan_uses_workspace_when_set (self ):
150
150
terraform = Mock (spec = Terraform )
151
151
task_factory = TaskFactory (
152
- terraform_factory = TerraformFactory (terraform )
152
+ terraform_factory = MockTerraformFactory (terraform )
153
153
)
154
154
workspace = "workspace"
155
155
source_directory = "/some/path"
@@ -170,7 +170,7 @@ def pre_task_function(_context, _, configuration: Configuration):
170
170
def test_plan_initialises_with_reconfigure (self ):
171
171
terraform = Mock (spec = Terraform )
172
172
task_factory = TaskFactory (
173
- terraform_factory = TerraformFactory (terraform )
173
+ terraform_factory = MockTerraformFactory (terraform )
174
174
)
175
175
source_directory = "/some/path"
176
176
@@ -193,7 +193,7 @@ def pre_task_function(_context, _, configuration: Configuration):
193
193
def test_plan_invokes_init_and_plan (self ):
194
194
terraform = Mock (spec = Terraform )
195
195
task_factory = TaskFactory (
196
- terraform_factory = TerraformFactory (terraform )
196
+ terraform_factory = MockTerraformFactory (terraform )
197
197
)
198
198
source_directory = "/some/path"
199
199
variables : Variables = {"foo" : 1 }
@@ -222,7 +222,7 @@ def pre_task_function(_context, _, configuration: Configuration):
222
222
def test_plan_uses_environment_in_all_commands_when_set (self ):
223
223
terraform = Mock (spec = Terraform )
224
224
task_factory = TaskFactory (
225
- terraform_factory = TerraformFactory (terraform )
225
+ terraform_factory = MockTerraformFactory (terraform )
226
226
)
227
227
source_directory = "/some/path"
228
228
environment = {"ENV_VAR" : "value" }
@@ -314,7 +314,7 @@ def test_adds_both_all_and_apply_parameters_to_apply_task(self):
314
314
def test_apply_invokes_init_and_apply (self ):
315
315
terraform = Mock (spec = Terraform )
316
316
task_factory = TaskFactory (
317
- terraform_factory = TerraformFactory (terraform )
317
+ terraform_factory = MockTerraformFactory (terraform )
318
318
)
319
319
source_directory = "/some/path"
320
320
variables : Variables = {"foo" : 1 }
@@ -346,7 +346,7 @@ def pre_task_function(_context, _, configuration: Configuration):
346
346
def test_apply_uses_workspace (self ):
347
347
terraform = Mock (spec = Terraform )
348
348
task_factory = TaskFactory (
349
- terraform_factory = TerraformFactory (terraform )
349
+ terraform_factory = MockTerraformFactory (terraform )
350
350
)
351
351
workspace = "workspace"
352
352
source_directory = "/some/path"
@@ -367,7 +367,7 @@ def pre_task_function(_context, _, configuration: Configuration):
367
367
def test_apply_uses_environment_in_all_commands_when_set (self ):
368
368
terraform = Mock (spec = Terraform )
369
369
task_factory = TaskFactory (
370
- terraform_factory = TerraformFactory (terraform )
370
+ terraform_factory = MockTerraformFactory (terraform )
371
371
)
372
372
source_directory = "/some/path"
373
373
environment = {"ENV_VAR" : "value" }
@@ -462,7 +462,7 @@ def test_adds_both_all_and_output_parameters_to_output_task(self):
462
462
def test_output_invokes_init_and_output (self ):
463
463
terraform = Mock (spec = Terraform )
464
464
task_factory = TaskFactory (
465
- terraform_factory = TerraformFactory (terraform )
465
+ terraform_factory = MockTerraformFactory (terraform )
466
466
)
467
467
source_directory = "/some/path"
468
468
backend_config : BackendConfig = {"path" : "state_file.tfstate" }
@@ -492,7 +492,7 @@ def pre_task_function(_context, _, configuration: Configuration):
492
492
def test_output_uses_workspace (self ):
493
493
terraform = Mock (spec = Terraform )
494
494
task_factory = TaskFactory (
495
- terraform_factory = TerraformFactory (terraform )
495
+ terraform_factory = MockTerraformFactory (terraform )
496
496
)
497
497
workspace = "workspace"
498
498
source_directory = "/some/path"
@@ -513,7 +513,7 @@ def pre_task_function(_context, _, configuration: Configuration):
513
513
def test_output_uses_json (self ):
514
514
terraform = Mock (spec = Terraform )
515
515
task_factory = TaskFactory (
516
- terraform_factory = TerraformFactory (terraform )
516
+ terraform_factory = MockTerraformFactory (terraform )
517
517
)
518
518
workspace = "workspace"
519
519
source_directory = "/some/path"
@@ -538,7 +538,7 @@ def pre_task_function(_context, _, configuration: Configuration):
538
538
def test_output_uses_environment_in_all_commands_when_set (self ):
539
539
terraform = Mock (spec = Terraform )
540
540
task_factory = TaskFactory (
541
- terraform_factory = TerraformFactory (terraform )
541
+ terraform_factory = MockTerraformFactory (terraform )
542
542
)
543
543
source_directory = "/some/path"
544
544
environment = {"ENV_VAR" : "value" }
@@ -578,7 +578,7 @@ def pre_task_function(_context, _, configuration: Configuration):
578
578
def test_output_returns_standard_output_when_capture_stdout_true (self ):
579
579
terraform = Mock (spec = Terraform )
580
580
task_factory = TaskFactory (
581
- terraform_factory = TerraformFactory (terraform )
581
+ terraform_factory = MockTerraformFactory (terraform )
582
582
)
583
583
source_directory = "/some/path"
584
584
0 commit comments