-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6c0ec6a
commit 1f6b635
Showing
13 changed files
with
342 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
servicecatalog_puppet/workflow/tag_policies/do_execute_tag_policies_task_test.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
from unittest import skip | ||
from servicecatalog_puppet.workflow import tasks_unit_tests_helper | ||
|
||
|
||
class DoExecuteTagPoliciesTaskTest(tasks_unit_tests_helper.PuppetTaskUnitTest): | ||
tag_policy_name = "tag_policy_name" | ||
region = "region" | ||
account_id = "account_id" | ||
ou_name = "ou_name" | ||
content = {} | ||
description = "description" | ||
manifest_file_path = "manifest_file_path" | ||
requested_priority= 1 | ||
|
||
def setUp(self) -> None: | ||
from servicecatalog_puppet.workflow.tag_policies import do_execute_tag_policies_task | ||
self.module = do_execute_tag_policies_task | ||
|
||
self.sut = self.module.DoExecuteTagPoliciesTask( | ||
**self.get_common_args(), | ||
tag_policy_name=self.tag_policy_name, region=self.region, account_id=self.account_id, ou_name=self.ou_name, content=self.content, description=self.description, manifest_file_path=self.manifest_file_path, requested_priority=self.requested_priority | ||
) | ||
|
||
self.wire_up_mocks() | ||
|
||
def test_params_for_results_display(self): | ||
# setup | ||
expected_result = { | ||
"puppet_account_id": self.puppet_account_id, | ||
"tag_policy_name": self.tag_policy_name, | ||
"region": self.region, | ||
"account_id": self.account_id, | ||
"ou_name": self.ou_name, | ||
"cache_invalidator": self.cache_invalidator, | ||
} | ||
|
||
# exercise | ||
actual_result = self.sut.params_for_results_display() | ||
|
||
# verify | ||
self.assertEqual(expected_result, actual_result) | ||
|
||
@skip | ||
def test_requires(self): | ||
# setup | ||
# exercise | ||
actual_result = self.sut.requires() | ||
|
||
# verify | ||
raise NotImplementedError() | ||
|
||
def test_api_calls_used(self): | ||
# setup | ||
expected_result = [ | ||
f"organizations.attach_policy_{self.region}", | ||
] | ||
|
||
# exercise | ||
actual_result = self.sut.api_calls_used() | ||
|
||
# verify | ||
self.assertEqual(expected_result, actual_result) | ||
|
||
@skip | ||
def test_run(self): | ||
# setup | ||
# exercise | ||
actual_result = self.sut.run() | ||
|
||
# verify | ||
raise NotImplementedError() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
servicecatalog_puppet/workflow/workspaces/prepare_account_for_workspace_task_test.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
from unittest import skip | ||
from servicecatalog_puppet.workflow import tasks_unit_tests_helper | ||
|
||
|
||
class PrepareAccountForWorkspaceTaskTest(tasks_unit_tests_helper.PuppetTaskUnitTest): | ||
account_id = "account_id" | ||
|
||
def setUp(self) -> None: | ||
from servicecatalog_puppet.workflow.workspaces import prepare_account_for_workspace_task | ||
self.module = prepare_account_for_workspace_task | ||
|
||
self.sut = self.module.PrepareAccountForWorkspaceTask( | ||
**self.get_common_args(), | ||
account_id=self.account_id | ||
) | ||
|
||
self.wire_up_mocks() | ||
|
||
def test_params_for_results_display(self): | ||
# setup | ||
expected_result = { | ||
"account_id": self.account_id, | ||
} | ||
|
||
# exercise | ||
actual_result = self.sut.params_for_results_display() | ||
|
||
# verify | ||
self.assertEqual(expected_result, actual_result) | ||
|
||
def test_api_calls_used(self): | ||
# setup | ||
expected_result = { | ||
f"cloudformation.create_or_update_{self.account_id}": 1, | ||
} | ||
|
||
# exercise | ||
actual_result = self.sut.api_calls_used() | ||
|
||
# verify | ||
self.assertEqual(expected_result, actual_result) | ||
|
||
@skip | ||
def test_run(self): | ||
# setup | ||
# exercise | ||
actual_result = self.sut.run() | ||
|
||
# verify | ||
raise NotImplementedError() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
servicecatalog_puppet/workflow/workspaces/provision_dry_run_workspace_task_test.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
from unittest import skip | ||
from servicecatalog_puppet.workflow import tasks_unit_tests_helper | ||
|
||
|
||
class ProvisionDryRunWorkspaceTaskTest(tasks_unit_tests_helper.PuppetTaskUnitTest): | ||
workspace_name = "workspace_name" | ||
region = "region" | ||
account_id = "account_id" | ||
bucket = "bucket" | ||
key = "key" | ||
version_id = "version_id" | ||
ssm_param_inputs = [] | ||
launch_parameters = {} | ||
manifest_parameters = {} | ||
account_parameters = {} | ||
ssm_param_outputs = [] | ||
execution = "execution" | ||
|
||
def setUp(self) -> None: | ||
from servicecatalog_puppet.workflow.workspaces import provision_dry_run_workspace_task | ||
self.module = provision_dry_run_workspace_task | ||
|
||
self.sut = self.module.ProvisionDryRunWorkspaceTask( | ||
**self.get_common_args(), | ||
workspace_name=self.workspace_name, region=self.region, account_id=self.account_id, bucket=self.bucket, key=self.key, version_id=self.version_id, ssm_param_inputs=self.ssm_param_inputs, launch_parameters=self.launch_parameters, manifest_parameters=self.manifest_parameters, account_parameters=self.account_parameters, ssm_param_outputs=self.ssm_param_outputs, execution=self.execution | ||
) | ||
|
||
self.wire_up_mocks() | ||
|
||
def test_params_for_results_display(self): | ||
# setup | ||
expected_result = { | ||
"puppet_account_id": self.puppet_account_id, | ||
"workspace_name": self.workspace_name, | ||
"region": self.region, | ||
"account_id": self.account_id, | ||
"cache_invalidator": self.cache_invalidator, | ||
} | ||
|
||
# exercise | ||
actual_result = self.sut.params_for_results_display() | ||
|
||
# verify | ||
self.assertEqual(expected_result, actual_result) | ||
|
||
@skip | ||
def test_run(self): | ||
# setup | ||
# exercise | ||
actual_result = self.sut.run() | ||
|
||
# verify | ||
raise NotImplementedError() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
servicecatalog_puppet/workflow/workspaces/provision_workspace_task_test.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
from unittest import skip | ||
from servicecatalog_puppet.workflow import tasks_unit_tests_helper | ||
|
||
|
||
class ProvisionWorkspaceTaskTest(tasks_unit_tests_helper.PuppetTaskUnitTest): | ||
workspace_name = "workspace_name" | ||
region = "region" | ||
account_id = "account_id" | ||
bucket = "bucket" | ||
key = "key" | ||
version_id = "version_id" | ||
ssm_param_inputs = [] | ||
launch_parameters = {} | ||
manifest_parameters = {} | ||
account_parameters = {} | ||
ssm_param_outputs = [] | ||
execution = "execution" | ||
manifest_file_path = "manifest_file_path" | ||
|
||
def setUp(self) -> None: | ||
from servicecatalog_puppet.workflow.workspaces import provision_workspace_task | ||
self.module = provision_workspace_task | ||
|
||
self.sut = self.module.ProvisionWorkspaceTask( | ||
**self.get_common_args(), | ||
workspace_name=self.workspace_name, region=self.region, account_id=self.account_id, bucket=self.bucket, key=self.key, version_id=self.version_id, ssm_param_inputs=self.ssm_param_inputs, launch_parameters=self.launch_parameters, manifest_parameters=self.manifest_parameters, account_parameters=self.account_parameters, ssm_param_outputs=self.ssm_param_outputs, execution=self.execution, manifest_file_path=self.manifest_file_path | ||
) | ||
|
||
self.wire_up_mocks() | ||
|
||
def test_params_for_results_display(self): | ||
# setup | ||
expected_result = { | ||
"puppet_account_id": self.puppet_account_id, | ||
"workspace_name": self.workspace_name, | ||
"region": self.region, | ||
"account_id": self.account_id, | ||
"cache_invalidator": self.cache_invalidator, | ||
} | ||
|
||
# exercise | ||
actual_result = self.sut.params_for_results_display() | ||
|
||
# verify | ||
self.assertEqual(expected_result, actual_result) | ||
|
||
@skip | ||
def test_run(self): | ||
# setup | ||
# exercise | ||
actual_result = self.sut.run() | ||
|
||
# verify | ||
raise NotImplementedError() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
servicecatalog_puppet/workflow/workspaces/terminate_dry_run_workspace_task_test.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
from unittest import skip | ||
from servicecatalog_puppet.workflow import tasks_unit_tests_helper | ||
|
||
|
||
class TerminateDryRunWorkspaceTaskTest(tasks_unit_tests_helper.PuppetTaskUnitTest): | ||
workspace_name = "workspace_name" | ||
region = "region" | ||
account_id = "account_id" | ||
bucket = "bucket" | ||
key = "key" | ||
version_id = "version_id" | ||
ssm_param_inputs = [] | ||
launch_parameters = {} | ||
manifest_parameters = {} | ||
account_parameters = {} | ||
ssm_param_outputs = [] | ||
execution = "execution" | ||
|
||
def setUp(self) -> None: | ||
from servicecatalog_puppet.workflow.workspaces import terminate_dry_run_workspace_task | ||
self.module = terminate_dry_run_workspace_task | ||
|
||
self.sut = self.module.TerminateDryRunWorkspaceTask( | ||
**self.get_common_args(), | ||
workspace_name=self.workspace_name, region=self.region, account_id=self.account_id, bucket=self.bucket, key=self.key, version_id=self.version_id, ssm_param_inputs=self.ssm_param_inputs, launch_parameters=self.launch_parameters, manifest_parameters=self.manifest_parameters, account_parameters=self.account_parameters, ssm_param_outputs=self.ssm_param_outputs, execution=self.execution | ||
) | ||
|
||
self.wire_up_mocks() | ||
|
||
def test_params_for_results_display(self): | ||
# setup | ||
expected_result = { | ||
"puppet_account_id": self.puppet_account_id, | ||
"workspace_name": self.workspace_name, | ||
"region": self.region, | ||
"account_id": self.account_id, | ||
"cache_invalidator": self.cache_invalidator, | ||
} | ||
|
||
# exercise | ||
actual_result = self.sut.params_for_results_display() | ||
|
||
# verify | ||
self.assertEqual(expected_result, actual_result) | ||
|
||
@skip | ||
def test_run(self): | ||
# setup | ||
# exercise | ||
actual_result = self.sut.run() | ||
|
||
# verify | ||
raise NotImplementedError() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.