From d9d055c75d4633650d7073ac07ed3261cd7a6d68 Mon Sep 17 00:00:00 2001 From: Asher Foa <1268088+asherf@users.noreply.github.com> Date: Mon, 20 Jan 2020 15:21:11 -0800 Subject: [PATCH 1/2] Fix more typos. --- moto/logs/responses.py | 4 +-- moto/rds2/models.py | 2 +- moto/rds2/responses.py | 4 +-- tests/test_ec2/test_route_tables.py | 4 +-- tests/test_ecr/test_ecr_boto3.py | 24 +++++++-------- tests/test_ecs/test_ecs_boto3.py | 2 +- tests/test_elbv2/test_elbv2.py | 2 +- tests/test_glue/test_datacatalog.py | 2 +- tests/test_kinesis/test_firehose.py | 2 +- tests/test_kinesis/test_kinesis.py | 2 +- tests/test_rds/test_rds.py | 8 ++--- tests/test_rds2/test_rds2.py | 30 +++++++++---------- tests/test_s3/test_s3.py | 2 +- .../test_s3bucket_path/test_s3bucket_path.py | 2 +- tests/test_sns/test_application.py | 12 ++++---- tests/test_sns/test_application_boto3.py | 12 ++++---- tests/test_sns/test_publishing_boto3.py | 2 +- tests/test_sqs/test_sqs.py | 4 +-- tests/test_swf/utils.py | 2 +- 19 files changed, 61 insertions(+), 61 deletions(-) diff --git a/moto/logs/responses.py b/moto/logs/responses.py index 072c76b71..4631da2f9 100644 --- a/moto/logs/responses.py +++ b/moto/logs/responses.py @@ -103,7 +103,7 @@ class LogsResponse(BaseResponse): ( events, next_backward_token, - next_foward_token, + next_forward_token, ) = self.logs_backend.get_log_events( log_group_name, log_stream_name, @@ -117,7 +117,7 @@ class LogsResponse(BaseResponse): { "events": events, "nextBackwardToken": next_backward_token, - "nextForwardToken": next_foward_token, + "nextForwardToken": next_forward_token, } ) diff --git a/moto/rds2/models.py b/moto/rds2/models.py index e648765b7..d2aa24a20 100644 --- a/moto/rds2/models.py +++ b/moto/rds2/models.py @@ -986,7 +986,7 @@ class RDS2Backend(BaseBackend): ) if option_group_kwargs["engine_name"] not in valid_option_group_engines.keys(): raise RDSClientError( - "InvalidParameterValue", "Invalid DB engine: non-existant" + "InvalidParameterValue", "Invalid DB engine: non-existent" ) if ( option_group_kwargs["major_engine_version"] diff --git a/moto/rds2/responses.py b/moto/rds2/responses.py index 625838d4d..7c815b2d5 100644 --- a/moto/rds2/responses.py +++ b/moto/rds2/responses.py @@ -367,14 +367,14 @@ class RDS2Response(BaseResponse): def modify_db_parameter_group(self): db_parameter_group_name = self._get_param("DBParameterGroupName") - db_parameter_group_parameters = self._get_db_parameter_group_paramters() + db_parameter_group_parameters = self._get_db_parameter_group_parameters() db_parameter_group = self.backend.modify_db_parameter_group( db_parameter_group_name, db_parameter_group_parameters ) template = self.response_template(MODIFY_DB_PARAMETER_GROUP_TEMPLATE) return template.render(db_parameter_group=db_parameter_group) - def _get_db_parameter_group_paramters(self): + def _get_db_parameter_group_parameters(self): parameter_group_parameters = defaultdict(dict) for param_name, value in self.querystring.items(): if not param_name.startswith("Parameters.Parameter"): diff --git a/tests/test_ec2/test_route_tables.py b/tests/test_ec2/test_route_tables.py index dfb3292b6..347464691 100644 --- a/tests/test_ec2/test_route_tables.py +++ b/tests/test_ec2/test_route_tables.py @@ -236,8 +236,8 @@ def test_route_table_associations(): @mock_ec2_deprecated def test_route_table_replace_route_table_association(): """ - Note: Boto has deprecated replace_route_table_assocation (which returns status) - and now uses replace_route_table_assocation_with_assoc (which returns association ID). + Note: Boto has deprecated replace_route_table_association (which returns status) + and now uses replace_route_table_association_with_assoc (which returns association ID). """ conn = boto.connect_vpc("the_key", "the_secret") vpc = conn.create_vpc("10.0.0.0/16") diff --git a/tests/test_ecr/test_ecr_boto3.py b/tests/test_ecr/test_ecr_boto3.py index 9115e3fad..82a2c7521 100644 --- a/tests/test_ecr/test_ecr_boto3.py +++ b/tests/test_ecr/test_ecr_boto3.py @@ -77,7 +77,7 @@ def test_describe_repositories(): response = client.describe_repositories() len(response["repositories"]).should.equal(2) - respository_arns = [ + repository_arns = [ "arn:aws:ecr:us-east-1:012345678910:repository/test_repository1", "arn:aws:ecr:us-east-1:012345678910:repository/test_repository0", ] @@ -86,9 +86,9 @@ def test_describe_repositories(): response["repositories"][0]["repositoryArn"], response["repositories"][1]["repositoryArn"], ] - ).should.equal(set(respository_arns)) + ).should.equal(set(repository_arns)) - respository_uris = [ + repository_uris = [ "012345678910.dkr.ecr.us-east-1.amazonaws.com/test_repository1", "012345678910.dkr.ecr.us-east-1.amazonaws.com/test_repository0", ] @@ -97,7 +97,7 @@ def test_describe_repositories(): response["repositories"][0]["repositoryUri"], response["repositories"][1]["repositoryUri"], ] - ).should.equal(set(respository_uris)) + ).should.equal(set(repository_uris)) @mock_ecr @@ -108,7 +108,7 @@ def test_describe_repositories_1(): response = client.describe_repositories(registryId="012345678910") len(response["repositories"]).should.equal(2) - respository_arns = [ + repository_arns = [ "arn:aws:ecr:us-east-1:012345678910:repository/test_repository1", "arn:aws:ecr:us-east-1:012345678910:repository/test_repository0", ] @@ -117,9 +117,9 @@ def test_describe_repositories_1(): response["repositories"][0]["repositoryArn"], response["repositories"][1]["repositoryArn"], ] - ).should.equal(set(respository_arns)) + ).should.equal(set(repository_arns)) - respository_uris = [ + repository_uris = [ "012345678910.dkr.ecr.us-east-1.amazonaws.com/test_repository1", "012345678910.dkr.ecr.us-east-1.amazonaws.com/test_repository0", ] @@ -128,7 +128,7 @@ def test_describe_repositories_1(): response["repositories"][0]["repositoryUri"], response["repositories"][1]["repositoryUri"], ] - ).should.equal(set(respository_uris)) + ).should.equal(set(repository_uris)) @mock_ecr @@ -147,11 +147,11 @@ def test_describe_repositories_3(): _ = client.create_repository(repositoryName="test_repository0") response = client.describe_repositories(repositoryNames=["test_repository1"]) len(response["repositories"]).should.equal(1) - respository_arn = "arn:aws:ecr:us-east-1:012345678910:repository/test_repository1" - response["repositories"][0]["repositoryArn"].should.equal(respository_arn) + repository_arn = "arn:aws:ecr:us-east-1:012345678910:repository/test_repository1" + response["repositories"][0]["repositoryArn"].should.equal(repository_arn) - respository_uri = "012345678910.dkr.ecr.us-east-1.amazonaws.com/test_repository1" - response["repositories"][0]["repositoryUri"].should.equal(respository_uri) + repository_uri = "012345678910.dkr.ecr.us-east-1.amazonaws.com/test_repository1" + response["repositories"][0]["repositoryUri"].should.equal(repository_uri) @mock_ecr diff --git a/tests/test_ecs/test_ecs_boto3.py b/tests/test_ecs/test_ecs_boto3.py index f1f1e04ae..69c920192 100644 --- a/tests/test_ecs/test_ecs_boto3.py +++ b/tests/test_ecs/test_ecs_boto3.py @@ -726,7 +726,7 @@ def test_delete_service(): @mock_ecs -def test_update_non_existant_service(): +def test_update_non_existent_service(): client = boto3.client("ecs", region_name="us-east-1") try: client.update_service( diff --git a/tests/test_elbv2/test_elbv2.py b/tests/test_elbv2/test_elbv2.py index eb5df14c3..af1b19f09 100644 --- a/tests/test_elbv2/test_elbv2.py +++ b/tests/test_elbv2/test_elbv2.py @@ -1391,7 +1391,7 @@ def test_set_security_groups(): len(resp["LoadBalancers"][0]["SecurityGroups"]).should.equal(2) with assert_raises(ClientError): - client.set_security_groups(LoadBalancerArn=arn, SecurityGroups=["non_existant"]) + client.set_security_groups(LoadBalancerArn=arn, SecurityGroups=["non_existent"]) @mock_elbv2 diff --git a/tests/test_glue/test_datacatalog.py b/tests/test_glue/test_datacatalog.py index 28281b18f..31731e598 100644 --- a/tests/test_glue/test_datacatalog.py +++ b/tests/test_glue/test_datacatalog.py @@ -132,7 +132,7 @@ def test_get_table_versions(): helpers.update_table(client, database_name, table_name, table_input) version_inputs["2"] = table_input - # Updateing with an indentical input should still create a new version + # Updateing with an identical input should still create a new version helpers.update_table(client, database_name, table_name, table_input) version_inputs["3"] = table_input diff --git a/tests/test_kinesis/test_firehose.py b/tests/test_kinesis/test_firehose.py index 5e8c4aa08..4f16dc82d 100644 --- a/tests/test_kinesis/test_firehose.py +++ b/tests/test_kinesis/test_firehose.py @@ -223,7 +223,7 @@ def test_create_stream_without_redshift(): @mock_kinesis -def test_deescribe_non_existant_stream(): +def test_deescribe_non_existent_stream(): client = boto3.client("firehose", region_name="us-east-1") client.describe_delivery_stream.when.called_with( diff --git a/tests/test_kinesis/test_kinesis.py b/tests/test_kinesis/test_kinesis.py index de1764892..b3251bb0f 100644 --- a/tests/test_kinesis/test_kinesis.py +++ b/tests/test_kinesis/test_kinesis.py @@ -32,7 +32,7 @@ def test_create_cluster(): @mock_kinesis_deprecated -def test_describe_non_existant_stream(): +def test_describe_non_existent_stream(): conn = boto.kinesis.connect_to_region("us-east-1") conn.describe_stream.when.called_with("not-a-stream").should.throw( ResourceNotFoundException diff --git a/tests/test_rds/test_rds.py b/tests/test_rds/test_rds.py index 4ebea0cf3..a3e7dc9dd 100644 --- a/tests/test_rds/test_rds.py +++ b/tests/test_rds/test_rds.py @@ -68,7 +68,7 @@ def test_get_databases_paginated(): @mock_rds_deprecated -def test_describe_non_existant_database(): +def test_describe_non_existent_database(): conn = boto.rds.connect_to_region("us-west-2") conn.get_all_dbinstances.when.called_with("not-a-db").should.throw(BotoServerError) @@ -86,7 +86,7 @@ def test_delete_database(): @mock_rds_deprecated -def test_delete_non_existant_database(): +def test_delete_non_existent_database(): conn = boto.rds.connect_to_region("us-west-2") conn.delete_dbinstance.when.called_with("not-a-db").should.throw(BotoServerError) @@ -119,7 +119,7 @@ def test_get_security_groups(): @mock_rds_deprecated -def test_get_non_existant_security_group(): +def test_get_non_existent_security_group(): conn = boto.rds.connect_to_region("us-west-2") conn.get_all_dbsecurity_groups.when.called_with("not-a-sg").should.throw( BotoServerError @@ -138,7 +138,7 @@ def test_delete_database_security_group(): @mock_rds_deprecated -def test_delete_non_existant_security_group(): +def test_delete_non_existent_security_group(): conn = boto.rds.connect_to_region("us-west-2") conn.delete_dbsecurity_group.when.called_with("not-a-db").should.throw( BotoServerError diff --git a/tests/test_rds2/test_rds2.py b/tests/test_rds2/test_rds2.py index 47b45539d..9a5a73678 100644 --- a/tests/test_rds2/test_rds2.py +++ b/tests/test_rds2/test_rds2.py @@ -312,7 +312,7 @@ def test_get_databases_paginated(): @mock_rds2 -def test_describe_non_existant_database(): +def test_describe_non_existent_database(): conn = boto3.client("rds", region_name="us-west-2") conn.describe_db_instances.when.called_with( DBInstanceIdentifier="not-a-db" @@ -378,7 +378,7 @@ def test_rename_db_instance(): @mock_rds2 -def test_modify_non_existant_database(): +def test_modify_non_existent_database(): conn = boto3.client("rds", region_name="us-west-2") conn.modify_db_instance.when.called_with( DBInstanceIdentifier="not-a-db", AllocatedStorage=20, ApplyImmediately=True @@ -403,7 +403,7 @@ def test_reboot_db_instance(): @mock_rds2 -def test_reboot_non_existant_database(): +def test_reboot_non_existent_database(): conn = boto3.client("rds", region_name="us-west-2") conn.reboot_db_instance.when.called_with( DBInstanceIdentifier="not-a-db" @@ -444,7 +444,7 @@ def test_delete_database(): @mock_rds2 -def test_delete_non_existant_database(): +def test_delete_non_existent_database(): conn = boto3.client("rds2", region_name="us-west-2") conn.delete_db_instance.when.called_with( DBInstanceIdentifier="not-a-db" @@ -663,7 +663,7 @@ def test_describe_option_group(): @mock_rds2 -def test_describe_non_existant_option_group(): +def test_describe_non_existent_option_group(): conn = boto3.client("rds", region_name="us-west-2") conn.describe_option_groups.when.called_with( OptionGroupName="not-a-option-group" @@ -688,10 +688,10 @@ def test_delete_option_group(): @mock_rds2 -def test_delete_non_existant_option_group(): +def test_delete_non_existent_option_group(): conn = boto3.client("rds", region_name="us-west-2") conn.delete_option_group.when.called_with( - OptionGroupName="non-existant" + OptionGroupName="non-existent" ).should.throw(ClientError) @@ -754,10 +754,10 @@ def test_modify_option_group_no_options(): @mock_rds2 -def test_modify_non_existant_option_group(): +def test_modify_non_existent_option_group(): conn = boto3.client("rds", region_name="us-west-2") conn.modify_option_group.when.called_with( - OptionGroupName="non-existant", + OptionGroupName="non-existent", OptionsToInclude=[ ( "OptionName", @@ -771,7 +771,7 @@ def test_modify_non_existant_option_group(): @mock_rds2 -def test_delete_non_existant_database(): +def test_delete_non_existent_database(): conn = boto3.client("rds", region_name="us-west-2") conn.delete_db_instance.when.called_with( DBInstanceIdentifier="not-a-db" @@ -1053,7 +1053,7 @@ def test_get_security_groups(): @mock_rds2 -def test_get_non_existant_security_group(): +def test_get_non_existent_security_group(): conn = boto3.client("rds", region_name="us-west-2") conn.describe_db_security_groups.when.called_with( DBSecurityGroupName="not-a-sg" @@ -1076,7 +1076,7 @@ def test_delete_database_security_group(): @mock_rds2 -def test_delete_non_existant_security_group(): +def test_delete_non_existent_security_group(): conn = boto3.client("rds", region_name="us-west-2") conn.delete_db_security_group.when.called_with( DBSecurityGroupName="not-a-db" @@ -1615,7 +1615,7 @@ def test_describe_db_parameter_group(): @mock_rds2 -def test_describe_non_existant_db_parameter_group(): +def test_describe_non_existent_db_parameter_group(): conn = boto3.client("rds", region_name="us-west-2") db_parameter_groups = conn.describe_db_parameter_groups(DBParameterGroupName="test") len(db_parameter_groups["DBParameterGroups"]).should.equal(0) @@ -1669,10 +1669,10 @@ def test_modify_db_parameter_group(): @mock_rds2 -def test_delete_non_existant_db_parameter_group(): +def test_delete_non_existent_db_parameter_group(): conn = boto3.client("rds", region_name="us-west-2") conn.delete_db_parameter_group.when.called_with( - DBParameterGroupName="non-existant" + DBParameterGroupName="non-existent" ).should.throw(ClientError) diff --git a/tests/test_s3/test_s3.py b/tests/test_s3/test_s3.py index 682213d13..294beca87 100644 --- a/tests/test_s3/test_s3.py +++ b/tests/test_s3/test_s3.py @@ -566,7 +566,7 @@ def test_bucket_deletion(): # Get non-existing bucket conn.get_bucket.when.called_with("foobar").should.throw(S3ResponseError) - # Delete non-existant bucket + # Delete non-existent bucket conn.delete_bucket.when.called_with("foobar").should.throw(S3ResponseError) diff --git a/tests/test_s3bucket_path/test_s3bucket_path.py b/tests/test_s3bucket_path/test_s3bucket_path.py index e204d0527..a1bdc5b02 100644 --- a/tests/test_s3bucket_path/test_s3bucket_path.py +++ b/tests/test_s3bucket_path/test_s3bucket_path.py @@ -174,7 +174,7 @@ def test_bucket_deletion(): # Get non-existing bucket conn.get_bucket.when.called_with("foobar").should.throw(S3ResponseError) - # Delete non-existant bucket + # Delete non-existent bucket conn.delete_bucket.when.called_with("foobar").should.throw(S3ResponseError) diff --git a/tests/test_sns/test_application.py b/tests/test_sns/test_application.py index e4fe93d53..1f5526219 100644 --- a/tests/test_sns/test_application.py +++ b/tests/test_sns/test_application.py @@ -88,8 +88,8 @@ def test_list_platform_applications(): conn.create_platform_application(name="application1", platform="APNS") conn.create_platform_application(name="application2", platform="APNS") - applications_repsonse = conn.list_platform_applications() - applications = applications_repsonse["ListPlatformApplicationsResponse"][ + applications_response = conn.list_platform_applications() + applications = applications_response["ListPlatformApplicationsResponse"][ "ListPlatformApplicationsResult" ]["PlatformApplications"] applications.should.have.length_of(2) @@ -101,8 +101,8 @@ def test_delete_platform_application(): conn.create_platform_application(name="application1", platform="APNS") conn.create_platform_application(name="application2", platform="APNS") - applications_repsonse = conn.list_platform_applications() - applications = applications_repsonse["ListPlatformApplicationsResponse"][ + applications_response = conn.list_platform_applications() + applications = applications_response["ListPlatformApplicationsResponse"][ "ListPlatformApplicationsResult" ]["PlatformApplications"] applications.should.have.length_of(2) @@ -110,8 +110,8 @@ def test_delete_platform_application(): application_arn = applications[0]["PlatformApplicationArn"] conn.delete_platform_application(application_arn) - applications_repsonse = conn.list_platform_applications() - applications = applications_repsonse["ListPlatformApplicationsResponse"][ + applications_response = conn.list_platform_applications() + applications = applications_response["ListPlatformApplicationsResponse"][ "ListPlatformApplicationsResult" ]["PlatformApplications"] applications.should.have.length_of(1) diff --git a/tests/test_sns/test_application_boto3.py b/tests/test_sns/test_application_boto3.py index 6f9be2926..f23b07543 100644 --- a/tests/test_sns/test_application_boto3.py +++ b/tests/test_sns/test_application_boto3.py @@ -88,8 +88,8 @@ def test_list_platform_applications(): Name="application2", Platform="APNS", Attributes={} ) - applications_repsonse = conn.list_platform_applications() - applications = applications_repsonse["PlatformApplications"] + applications_response = conn.list_platform_applications() + applications = applications_response["PlatformApplications"] applications.should.have.length_of(2) @@ -103,15 +103,15 @@ def test_delete_platform_application(): Name="application2", Platform="APNS", Attributes={} ) - applications_repsonse = conn.list_platform_applications() - applications = applications_repsonse["PlatformApplications"] + applications_response = conn.list_platform_applications() + applications = applications_response["PlatformApplications"] applications.should.have.length_of(2) application_arn = applications[0]["PlatformApplicationArn"] conn.delete_platform_application(PlatformApplicationArn=application_arn) - applications_repsonse = conn.list_platform_applications() - applications = applications_repsonse["PlatformApplications"] + applications_response = conn.list_platform_applications() + applications = applications_response["PlatformApplications"] applications.should.have.length_of(1) diff --git a/tests/test_sns/test_publishing_boto3.py b/tests/test_sns/test_publishing_boto3.py index d85c8fefe..51e0a9f57 100644 --- a/tests/test_sns/test_publishing_boto3.py +++ b/tests/test_sns/test_publishing_boto3.py @@ -806,7 +806,7 @@ def test_filtering_string_array_with_string_no_array_no_match(): topic.publish( Message="no_match", MessageAttributes={ - "price": {"DataType": "String.Array", "StringValue": "one hundread"} + "price": {"DataType": "String.Array", "StringValue": "one hundred"} }, ) diff --git a/tests/test_sqs/test_sqs.py b/tests/test_sqs/test_sqs.py index c74c3822a..413b16f80 100644 --- a/tests/test_sqs/test_sqs.py +++ b/tests/test_sqs/test_sqs.py @@ -208,7 +208,7 @@ def test_message_with_complex_attributes(): "ccc": {"StringValue": "testjunk", "DataType": "String"}, "aaa": {"BinaryValue": b"\x02\x03\x04", "DataType": "Binary"}, "zzz": {"DataType": "Number", "StringValue": "0230.01"}, - "öther_encodings": {"DataType": "String", "StringValue": "T\xFCst"}, + "öthere_encodings": {"DataType": "String", "StringValue": "T\xFCst"}, }, ) msg.get("MD5OfMessageBody").should.equal("58fd9edd83341c29f1aebba81c31e257") @@ -1197,7 +1197,7 @@ def test_permissions(): client.remove_permission(QueueUrl=queue_url, Label="account2") with assert_raises(ClientError): - client.remove_permission(QueueUrl=queue_url, Label="non_existant") + client.remove_permission(QueueUrl=queue_url, Label="non_existent") @mock_sqs diff --git a/tests/test_swf/utils.py b/tests/test_swf/utils.py index 48c2cbd94..2b2a2d025 100644 --- a/tests/test_swf/utils.py +++ b/tests/test_swf/utils.py @@ -5,7 +5,7 @@ from moto.swf.models import ActivityType, Domain, WorkflowType, WorkflowExecutio # Some useful constants # Here are some activity timeouts we use in moto/swf tests ; they're extracted -# from semi-real world example, the goal is mostly to have predictible and +# from semi-real world example, the goal is mostly to have predictable and # intuitive behaviour in moto/swf own tests... ACTIVITY_TASK_TIMEOUTS = { "heartbeatTimeout": "300", # 5 mins From b4127040d1c09547956e64122e2960f1ca3bf9be Mon Sep 17 00:00:00 2001 From: Asher Foa <1268088+asherf@users.noreply.github.com> Date: Thu, 23 Jan 2020 10:16:12 -0800 Subject: [PATCH 2/2] remove this change. --- tests/test_sqs/test_sqs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_sqs/test_sqs.py b/tests/test_sqs/test_sqs.py index 413b16f80..1eb511db0 100644 --- a/tests/test_sqs/test_sqs.py +++ b/tests/test_sqs/test_sqs.py @@ -208,7 +208,7 @@ def test_message_with_complex_attributes(): "ccc": {"StringValue": "testjunk", "DataType": "String"}, "aaa": {"BinaryValue": b"\x02\x03\x04", "DataType": "Binary"}, "zzz": {"DataType": "Number", "StringValue": "0230.01"}, - "öthere_encodings": {"DataType": "String", "StringValue": "T\xFCst"}, + "öther_encodings": {"DataType": "String", "StringValue": "T\xFCst"}, }, ) msg.get("MD5OfMessageBody").should.equal("58fd9edd83341c29f1aebba81c31e257")