tests package

Submodules

tests.test_apigateway module

class tests.test_apigateway.TestGatewayResponse(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_response_type()[source]
class tests.test_apigateway.TestModel(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_schema()[source]

tests.test_apigatewayv2 module

class tests.test_apigatewayv2.TestAuthorizer(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_response_type()[source]
class tests.test_apigatewayv2.TestIntegrationResponse(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_response_type()[source]
class tests.test_apigatewayv2.TestModel(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_schema()[source]

tests.test_appsync module

class tests.test_appsync.TestAppsyncResolver(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_resolver()[source]
test_resolver_kind_bad_value()[source]

tests.test_asg module

class tests.test_asg.TestAutoScalingGroup(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_AutoScalingRollingUpdate_all_defaults()[source]
test_AutoScalingRollingUpdate_validation()[source]
test_exclusive()[source]
test_helperfn_as_AutoScalingRollingUpdate()[source]
test_helperfn_as_updatepolicy()[source]
test_instanceid()[source]
test_launchconfigurationname()[source]
test_none()[source]
test_size_if()[source]

tests.test_awslambda module

class tests.test_awslambda.TestAWSLambda(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_check_zip_file()[source]
test_environment_variable_invalid_name()[source]
test_environment_variable_not_reserved()[source]
test_environment_variable_reserved()[source]
test_exclusive()[source]
test_package_type_image()[source]
test_package_type_invalid()[source]
test_package_type_zip()[source]
test_zip_file()[source]
class tests.test_awslambda.TestCode(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_validate_image_and_s3()[source]
test_validate_image_and_zip()[source]
test_validate_image_uri()[source]
test_validate_s3()[source]
test_validate_s3_missing_required()[source]
test_validate_zip_and_s3()[source]
class tests.test_awslambda.TestImageConfig(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_validate_command()[source]
test_validate_command_too_long()[source]
test_validate_empty()[source]
test_validate_entry_point()[source]
test_validate_entry_point_too_long()[source]
test_validate_memory_size_boundaries()[source]
test_validate_memory_size_throws()[source]
test_validate_working_directory()[source]
test_validate_working_directory_too_long()[source]

tests.test_basic module

class tests.test_basic.FakeAWSObject(title: Optional[str], template: Optional[troposphere.Template] = None, validation: bool = True, **kwargs: Any)[source]

Bases: troposphere.AWSObject

attributes: List[str]
do_validation: bool
properties: Dict[str, Any]
propnames: Set[str]
props: ClassVar[Dict[str, Tuple[Union[Tuple[type, ...], type, Callable[[Any], Any]], bool]]] = {'callcorrect': (<function call_correct>, False), 'callincorrect': (<function call_incorrect>, False), 'helperfun': (<function positive_integer>, False), 'listhelperfun': ([<function double>], False), 'multilist': ([<class 'bool'>, <class 'int'>, <class 'float'>], False), 'multituple': ((<class 'bool'>, <class 'int'>), False), 'singlelist': (<class 'list'>, False)}
resource: Dict[str, Any]
resource_type: Optional[str]
template: Optional[Template]
title: Optional[str]
type = 'Fake::AWS::Object'
validate()[source]
class tests.test_basic.FakeAWSProperty(title: Optional[str] = None, **kwargs: Any)[source]

Bases: troposphere.AWSProperty

attributes: List[str]
do_validation: bool
properties: Dict[str, Any]
propnames: Set[str]
props: ClassVar[Dict[str, Tuple[Union[Tuple[type, ...], type, Callable[[Any], Any]], bool]]] = {}
resource: Dict[str, Any]
resource_type: Optional[str]
template: Optional[Template]
title: Optional[str]
class tests.test_basic.TestAttributes(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_BogusAttribute()[source]
test_UpdateReplacePolicy()[source]
class tests.test_basic.TestBasic(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_badproperty()[source]
test_badrequired()[source]
test_badtype()[source]
test_depends_on_helper_with_resource()[source]
test_depends_on_helper_with_string()[source]
test_extraattribute()[source]
test_goodrequired()[source]
test_pickle_ok()[source]
test_resource_depends_on()[source]
test_resource_depends_on_attr()[source]
test_resource_depends_on_list()[source]
class tests.test_basic.TestCidr(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_getcidr()[source]
test_getcidr_withsizemask()[source]
class tests.test_basic.TestDuplicate(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_output()[source]
test_parameter()[source]
test_resource()[source]
class tests.test_basic.TestHealthCheck(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_healthy_interval_ok()[source]
test_healthy_interval_too_low()[source]
class tests.test_basic.TestJoin(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_join()[source]
class tests.test_basic.TestName(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_ref()[source]
class tests.test_basic.TestOutput(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_empty_awsproperty_outputs_empty_object()[source]
test_noproperty()[source]
class tests.test_basic.TestParameter(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_add_or_get_returns_with_out_adding_duplicate()[source]
test_get_or_add_adds()[source]
test_invalid_parameter_property_in_template()[source]
test_noproperty()[source]
test_property_default()[source]
test_property_validator()[source]
class tests.test_basic.TestProperty(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_awsproperty_invalid_property()[source]
test_noproperty()[source]
class tests.test_basic.TestRef(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_ref()[source]
test_ref_eq()[source]
test_ref_hash()[source]
class tests.test_basic.TestSplit(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_split()[source]
class tests.test_basic.TestSub(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_sub_with_vars_mix()[source]
test_sub_with_vars_not_unpakaged()[source]
test_sub_with_vars_unpakaged()[source]
test_sub_without_vars()[source]
class tests.test_basic.TestValidation(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_no_validation_method()[source]
test_novalidation()[source]
test_validation()[source]
class tests.test_basic.TestValidators(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_badlist()[source]
test_badmultilist()[source]
test_callcorrect()[source]
test_callincorrect()[source]
test_error_message()[source]
test_exception()[source]
test_helperfun()[source]
test_list()[source]
test_listhelperfun()[source]
test_multilist()[source]
test_mutualexclusion()[source]
test_tuples()[source]
tests.test_basic.call_correct(x)[source]
tests.test_basic.call_incorrect(x)[source]
tests.test_basic.double(x)[source]

tests.test_cloudformation module

class tests.test_cloudformation.TestWaitCondition(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_CreationPolicy()[source]
test_CreationPolicyWithProps()[source]
test_RequiredProps()[source]

tests.test_cloudwatch module

class tests.test_cloudwatch.TestCloudWatchValidators(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_validate_treat_missing_data()[source]
test_validate_units()[source]
class tests.test_cloudwatch.TestModel(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_dashboard()[source]

tests.test_codebuild module

class tests.test_codebuild.TestCodeBuild(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_arm_environment()[source]
test_linux_environment()[source]
test_linux_gpu_environment()[source]
test_source_codepipeline()[source]
test_windows_environment()[source]
class tests.test_codebuild.TestCodeBuildFilters(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_filter()[source]
test_filter_element_not_a_list()[source]
test_filter_fail()[source]
test_filter_no_filtergroup()[source]
test_filter_not_list()[source]

tests.test_codecommit module

class tests.test_codecommit.TestCodeCommit(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_trigger()[source]

tests.test_config module

class tests.test_config.TestConfig(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_SourceDetails()[source]
test_invalid_SourceDetails_MaximumExecutionFrequency()[source]

tests.test_dict module

class tests.test_dict.TestDict(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_invalid_sub_property()[source]
test_invalid_subproperty_definition()[source]
test_invalid_toplevel_property()[source]
test_sub_property_helper_fn()[source]
test_tags_from_dict()[source]
test_toplevel_helper_fn()[source]
test_valid_data()[source]

tests.test_ec2 module

class tests.test_ec2.TestEC2(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_securitygroupegress()[source]
test_vpn_conn_cannot_have_customer_gateway_and_transit_gateway()[source]

tests.test_ecr module

class tests.test_ecr.TestECS(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_ecr_with_tags()[source]

tests.test_ecs module

class tests.test_ecs.TestECS(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_allow_container_healthcheck()[source]
test_allow_placement_strategy_constraint()[source]
test_allow_port_mapping_protocol()[source]
test_allow_ref_cluster()[source]
test_allow_ref_task_role_arn()[source]
test_allow_scheduling_strategy()[source]
test_allow_string_cluster()[source]
test_allow_string_task_role_arn()[source]
test_docker_volume_configuration()[source]
test_fargate_launch_type()[source]
test_port_mapping_does_not_require_protocol()[source]
test_task_role_arn_is_optional()[source]
class tests.test_ecs.TestECSValidators(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_network_port()[source]
test_scaling_step_size()[source]
test_scope_validator()[source]

tests.test_efs module

class tests.test_efs.TestEfs(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_validData()[source]
test_validateBackupPolicy()[source]
test_validateProvisionedThroughputInMibps()[source]
test_validateThroughputMode()[source]
class tests.test_efs.TestEfsTemplate(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_bucket_template()[source]

tests.test_eks module

class tests.test_eks.TestEKSValidators(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_cluster_logging()[source]
test_validate_taint_effect()[source]
test_validate_taint_key()[source]
test_validate_taint_value()[source]

tests.test_elasticloadbalancerv2 module

class tests.test_elasticloadbalancerv2.TestListenerActions(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_fixed_response_action()[source]
test_fixed_response_config_one_of()[source]
test_fixed_response_config_only_with_fixed_response()[source]
test_fixed_response_requires_fixed_response_config()[source]
test_forward_action()[source]
test_forward_action_requires_target_arn()[source]
test_redirect_action()[source]
test_redirect_action_config_one_of()[source]
test_redirect_action_requires_redirect_config()[source]
test_redirect_config_only_with_redirect()[source]
test_target_arn_only_forward()[source]
class tests.test_elasticloadbalancerv2.TestTargetGroup(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_instance_targettype_requires_properties()[source]
test_invalid_targettype_is_rejected()[source]
test_ip_targettype_requires_properties()[source]
test_lambda_targettype_rejects_properties()[source]
test_no_targettype_requires_properties()[source]

tests.test_emr module

class tests.test_emr.TestEMR(methodName='runTest')[source]

Bases: unittest.case.TestCase

generate_rules(rules_name)[source]
simple_helper(adjustment, scaling)[source]
test_Configuration()[source]
test_SimpleScalingPolicyConfiguration()[source]
test_allow_string_cluster()[source]

tests.test_examples module

class tests.test_examples.TestExamples(methodName='runTest')[source]

Bases: unittest.case.TestCase

expected_output = None
filename = None
maxDiff = None
test_example()[source]
tests.test_examples.create_test_class(testname, **kwargs)[source]
tests.test_examples.load_tests(loader, tests, pattern)[source]

tests.test_examples_template_generator module

class tests.test_examples_template_generator.TestTemplateGenerator(methodName='runTest')[source]

Bases: unittest.case.TestCase

expected_output = None
filename = None
maxDiff = None
test_template_generator()[source]

Ensures that all example outputs can be loaded into the template generator and back to JSON with no difference.

tests.test_examples_template_generator.create_test_class(testname, **kwargs)[source]
tests.test_examples_template_generator.load_tests(loader, tests, pattern)[source]

tests.test_guardduty module

class tests.test_guardduty.TestGuardDuty(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_guardduty_detector()[source]
test_guardduty_ipset()[source]
test_guardduty_threatintelset()[source]

tests.test_int_type module

class tests.test_int_type.TestIntTypeShouldNotBeUsed(methodName='runTest')[source]

Bases: unittest.case.TestCase

assertNoIntType(obj)[source]
get_aws_objects()[source]
test_there_should_not_be_any_awsobject_with_int_in_props()[source]

Anything that requires an integer should use validators.integer rather than int, because int does not work with types that behave like an integer (i.e. long in Python 2).

tests.test_iot1click module

class tests.test_iot1click.TestPlacementTemplate(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_placement_template()[source]

tests.test_logs module

class tests.test_logs.TestLogs(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_log_destination()[source]
test_loggroup_deletionpolicy_is_preserved()[source]
test_loggroup_retention()[source]
test_validate_resource_policy()[source]

tests.test_mappings module

class tests.test_mappings.TestMappings(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_multiple_mappings()[source]
test_single_mapping()[source]

tests.test_opensearchservice module

class tests.test_opensearchservice.TestOpenSearchServiceValidators(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_validate_search_service_engine_version()[source]

tests.test_opsworks module

class tests.test_opsworks.TestOpsWorksStack(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_custom_json()[source]
test_no_required()[source]
test_nosubnet()[source]
test_required()[source]
test_stack()[source]

tests.test_parameters module

class tests.test_parameters.TestInitArguments(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_ref_can_be_requested()[source]
test_title_max_length()[source]

tests.test_policies module

class tests.test_policies.TestCreationPolicy(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_auto_scaling_creation_policy()[source]
test_auto_scaling_creation_policy_json()[source]
test_invalid_pausetime()[source]
test_json()[source]
test_works()[source]
class tests.test_policies.TestUpdatePolicy(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_invalid_pausetime()[source]
test_json()[source]
test_mininstances()[source]
test_mininstances_maxsize_is_ref()[source]
test_mininstances_mininstancesinservice_is_ref()[source]
test_works()[source]

tests.test_rds module

class tests.test_rds.TestRDS(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_az_and_multiaz_funcs()[source]
test_fail_az_and_multiaz()[source]
test_io1_storage_type_and_iops()[source]
test_it_allows_an_rds_instance_created_from_a_snapshot()[source]
test_it_allows_an_rds_instance_with_iops()[source]
test_it_allows_an_rds_instance_with_master_username_and_password()[source]
test_it_allows_an_rds_replica()[source]
test_it_rds_instances_require_either_a_snapshot_or_credentials()[source]
test_it_rds_instances_require_encryption_if_kms_key_provided()[source]
test_no_snapshot_or_engine()[source]
test_optiongroup()[source]
test_replica_settings_are_inherited()[source]
test_snapshot()[source]
test_snapshot_and_engine()[source]
test_storage_to_iops_ratio()[source]
class tests.test_rds.TestRDSValidators(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_validate_backup_retention_period()[source]
test_validate_backup_window()[source]
test_validate_capacity()[source]
test_validate_engine()[source]
test_validate_engine_mode()[source]
test_validate_iops()[source]
test_validate_license_model()[source]
test_validate_maintenance_window()[source]
test_validate_storage_type()[source]

tests.test_s3 module

class tests.test_s3.TestBucket(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_bucket_accesscontrol()[source]
test_bucket_accesscontrol_bad_string()[source]
test_bucket_accesscontrol_bad_type()[source]
test_bucket_accesscontrol_ref()[source]
class tests.test_s3.TestBucketTemplate(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_bucket_template()[source]
class tests.test_s3.TestS3AccelerateConfiguration(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_accelerate_configuration_enabled()[source]
test_accelerate_configuration_invalid_value()[source]
test_accelerate_configuration_suspended()[source]
test_s3_bucket_accelerate_configuration()[source]

tests.test_serverless module

class tests.test_serverless.TestServerless(methodName='runTest')[source]

Bases: unittest.case.TestCase

swagger = {'info': {'title': 'swagger test'}, 'paths': {'/test': {'get': {}}}, 'swagger': '2.0'}
test_DLQ()[source]
test_api_auth_resource_policy()[source]
test_api_no_definition()[source]
test_api_with_domain()[source]
test_api_with_endpoint_configuration()[source]
test_exactly_one_code()[source]
test_globals()[source]
test_http_api_authorization_scopes()[source]
test_http_api_both_definition_uri_and_body_defined()[source]
test_http_api_definition_body()[source]
test_http_api_definition_uri_defined()[source]
test_http_api_no_definition()[source]
test_http_api_with_domain()[source]
test_layer_version()[source]
test_optional_auto_publish_alias()[source]
test_optional_deployment_preference()[source]
test_packaging()[source]
test_policy_document()[source]
test_required_api_both()[source]
test_required_api_definitionbody()[source]
test_required_api_definitionuri()[source]
test_required_function()[source]
test_s3_filter()[source]
test_s3_location()[source]
test_simple_table()[source]
test_tags()[source]

tests.test_sqs module

class tests.test_sqs.TestQueue(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_QueueName()[source]

tests.test_stepfunctions module

class tests.test_stepfunctions.TestStepFunctions(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_activity()[source]
test_statemachine()[source]
test_statemachine_missing_parameter()[source]

tests.test_tags module

class tests.test_tags.TestTags(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_ASTagAddition()[source]
test_Formats()[source]
test_TagAddition()[source]
test_TagConditional()[source]
test_Unsortable()[source]

tests.test_template module

class tests.test_template.TestAwsInterface(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_parameter_group()[source]
test_parameter_label()[source]
test_parameter_label_replace()[source]
class tests.test_template.TestEquality(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_eq()[source]
test_hash()[source]
test_ne()[source]
class tests.test_template.TestInitArguments(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_description()[source]
test_description_default()[source]
test_globals()[source]
test_metadata()[source]
test_metadata_default()[source]
test_transform()[source]
class tests.test_template.TestRules(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_rules()[source]
class tests.test_template.TestValidate(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_max_mappings()[source]
test_max_outputs()[source]
test_max_parameters()[source]
test_max_resources()[source]

tests.test_template_generator module

class tests.test_template_generator.MyCustomResource(title: Optional[str], template: Optional[troposphere.Template] = None, validation: bool = True, **kwargs: Any)[source]

Bases: troposphere.AWSObject

attributes: List[str]
do_validation: bool
properties: Dict[str, Any]
propnames: Set[str]
props: ClassVar[Dict[str, Tuple[Union[Tuple[type, ...], type, Callable[[Any], Any]], bool]]] = {'Foo': (<class 'str'>, True), 'ServiceToken': (<class 'str'>, True)}
resource: Dict[str, Any]
resource_type: Optional[str] = 'Custom::Resource'
template: Optional[Template]
title: Optional[str]
class tests.test_template_generator.MyMacroResource(title: Optional[str], template: Optional[troposphere.Template] = None, validation: bool = True, **kwargs: Any)[source]

Bases: troposphere.AWSObject

attributes: List[str]
do_validation: bool
properties: Dict[str, Any]
propnames: Set[str]
props: ClassVar[Dict[str, Tuple[Union[Tuple[type, ...], type, Callable[[Any], Any]], bool]]] = {'Foo': (<class 'str'>, True)}
resource: Dict[str, Any]
resource_type: Optional[str] = 'Some::Special::Resource'
template: Optional[Template]
title: Optional[str]
class tests.test_template_generator.TestTemplateGenerator(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_custom_resource_override()[source]

Ensures that a custom member can be defined.

test_custom_resource_type()[source]

Ensures that a custom resource type is implicitly defined.

test_macro_resource()[source]

Ensures that a custom member can be defined.

test_no_nested_name()[source]

Prevent regression for ensuring no nested Name (Issue #977)

test_resource_type_not_defined()[source]
test_unknown_resource_type()[source]

tests.test_userdata module

class tests.test_userdata.TestUserdata(methodName='runTest')[source]

Bases: unittest.case.TestCase

create_answer(command_list, delimiter='')[source]
create_result(file, delimiter='')[source]
setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_char_escaping()[source]
test_empty_file()[source]
test_nonexistant_file()[source]
test_one_line_file()[source]
test_simple()[source]

tests.test_validators module

class tests.test_validators.TestValidators(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_backup_vault_name()[source]
test_boolean()[source]
test_check_required()[source]
test_compliance_level()[source]
test_elb_name()[source]
test_encoding()[source]
test_iam_group_name()[source]
test_iam_names()[source]
test_iam_path()[source]
test_iam_role_name()[source]
test_iam_user_name()[source]
test_integer()[source]
test_integer_range()[source]
test_mutually_exclusive()[source]
test_mutually_exclusive_novalue()[source]
test_network_port()[source]
test_network_port_ref()[source]
test_notification_event()[source]
test_notification_type()[source]
test_one_of()[source]
test_operating_system()[source]
test_positive_integer()[source]
test_s3_bucket_name()[source]
test_status()[source]
test_tags_or_list()[source]
test_task_type()[source]
test_tg_healthcheck_port()[source]
test_tg_healthcheck_port_ref()[source]
test_waf_action_type()[source]

tests.test_yaml module

class tests.test_yaml.TestYAML(methodName='runTest')[source]

Bases: unittest.case.TestCase

test_s3_bucket()[source]
test_yaml_long_form()[source]

Module contents