-
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
14e6d8c
commit 6c0ec6a
Showing
21 changed files
with
527 additions
and
127 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
52 changes: 0 additions & 52 deletions
52
servicecatalog_puppet/workflow/apps/provision_app_task_test.py
This file was deleted.
Oops, something went wrong.
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
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
67 changes: 67 additions & 0 deletions
67
servicecatalog_puppet/workflow/codebuild_runs/do_execute_code_build_run_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,67 @@ | ||
from unittest import skip | ||
from servicecatalog_puppet.workflow import tasks_unit_tests_helper | ||
|
||
|
||
class DoExecuteCodeBuildRunTaskTest(tasks_unit_tests_helper.PuppetTaskUnitTest): | ||
code_build_run_name = "code_build_run_name" | ||
region = "region" | ||
account_id = "account_id" | ||
project_name = "project_name" | ||
manifest_file_path = "manifest_file_path" | ||
|
||
def setUp(self) -> None: | ||
from servicecatalog_puppet.workflow.codebuild_runs import ( | ||
do_execute_code_build_run_task, | ||
) | ||
|
||
self.module = do_execute_code_build_run_task | ||
|
||
self.sut = self.module.DoExecuteCodeBuildRunTask( | ||
**self.get_common_args(), | ||
code_build_run_name=self.code_build_run_name, | ||
region=self.region, | ||
account_id=self.account_id, | ||
project_name=self.project_name, | ||
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, | ||
"code_build_run_name": self.code_build_run_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_api_calls_used(self): | ||
# setup | ||
expected_result = [ | ||
f"codebuild.start_build_{self.get_account_used()}_{self.project_name}", | ||
f"codebuild.batch_get_projects_{self.get_account_used()}_{self.project_name}", | ||
] | ||
|
||
# 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 was deleted.
Oops, something went wrong.
57 changes: 0 additions & 57 deletions
57
servicecatalog_puppet/workflow/generic/generic_schedule_run_deploy_in_spoke_task.py
This file was deleted.
Oops, something went wrong.
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
70 changes: 70 additions & 0 deletions
70
servicecatalog_puppet/workflow/lambda_invocations/do_invoke_lambda_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,70 @@ | ||
from unittest import skip | ||
from servicecatalog_puppet.workflow import tasks_unit_tests_helper | ||
|
||
|
||
class DoInvokeLambdaTaskTest(tasks_unit_tests_helper.PuppetTaskUnitTest): | ||
lambda_invocation_name = "lambda_invocation_name" | ||
region = "region" | ||
account_id = "account_id" | ||
function_name = "function_name" | ||
qualifier = "qualifier" | ||
invocation_type = "invocation_type" | ||
manifest_file_path = "manifest_file_path" | ||
|
||
def setUp(self) -> None: | ||
from servicecatalog_puppet.workflow.lambda_invocations import ( | ||
do_invoke_lambda_task, | ||
) | ||
|
||
self.module = do_invoke_lambda_task | ||
|
||
self.sut = self.module.DoInvokeLambdaTask( | ||
**self.get_common_args(), | ||
lambda_invocation_name=self.lambda_invocation_name, | ||
region=self.region, | ||
account_id=self.account_id, | ||
function_name=self.function_name, | ||
qualifier=self.qualifier, | ||
invocation_type=self.invocation_type, | ||
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, | ||
"lambda_invocation_name": self.lambda_invocation_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_api_calls_used(self): | ||
# setup | ||
expected_result = { | ||
f"lambda.invoke_{self.get_account_used()}_{self.region}": 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
80 changes: 80 additions & 0 deletions
80
servicecatalog_puppet/workflow/launch/do_terminate_product_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,80 @@ | ||
from unittest import skip | ||
from servicecatalog_puppet.workflow import tasks_unit_tests_helper | ||
|
||
|
||
class DoTerminateProductTaskTest(tasks_unit_tests_helper.PuppetTaskUnitTest): | ||
launch_name = "launch_name" | ||
region = "region" | ||
account_id = "account_id" | ||
portfolio = "portfolio" | ||
product = "product" | ||
version = "version" | ||
ssm_param_inputs = [] | ||
launch_parameters = {} | ||
manifest_parameters = {} | ||
account_parameters = {} | ||
ssm_param_outputs = [] | ||
execution = "execution" | ||
|
||
def setUp(self) -> None: | ||
from servicecatalog_puppet.workflow.launch import do_terminate_product_task | ||
|
||
self.module = do_terminate_product_task | ||
|
||
self.sut = self.module.DoTerminateProductTask( | ||
**self.get_common_args(), | ||
launch_name=self.launch_name, | ||
region=self.region, | ||
account_id=self.account_id, | ||
portfolio=self.portfolio, | ||
product=self.product, | ||
version=self.version, | ||
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, | ||
"launch_name": self.launch_name, | ||
"account_id": self.account_id, | ||
"region": self.region, | ||
"cache_invalidator": self.cache_invalidator, | ||
} | ||
|
||
# exercise | ||
actual_result = self.sut.params_for_results_display() | ||
|
||
# verify | ||
self.assertEqual(expected_result, actual_result) | ||
|
||
def test_api_calls_used(self): | ||
# setup | ||
uniq = f"{self.account_id}_{self.region}" | ||
expected_result = [ | ||
f"servicecatalog.describe_provisioned_product_{uniq}", | ||
f"servicecatalog.terminate_provisioned_product_{uniq}", | ||
f"servicecatalog.describe_record_{uniq}", | ||
] | ||
|
||
# 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
Oops, something went wrong.