Skip to content

Commit

Permalink
Formatting Fix-ups (#8541)
Browse files Browse the repository at this point in the history
  • Loading branch information
snordhausen authored Feb 1, 2025
1 parent 024067f commit 714f9fd
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 21 deletions.
4 changes: 2 additions & 2 deletions moto/athena/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def __init__(
self.configuration["EnforceWorkGroupConfiguration"] = True
if "EngineVersion" not in self.configuration:
self.configuration["EngineVersion"] = {
"EffectiveEngineVersion": "Athena engine " "version 3",
"EffectiveEngineVersion": "Athena engine version 3",
"SelectedEngineVersion": "AUTO",
}
if "PublishCloudWatchMetricsEnabled" not in self.configuration:
Expand Down Expand Up @@ -346,7 +346,7 @@ def _store_query_result_in_s3(self, exec_id: str) -> None:
for row in self.query_results[exec_id].rows:
query_result += ",".join(
[
f"\"{r['VarCharValue']}\"" if "VarCharValue" in r else ""
f'"{r["VarCharValue"]}"' if "VarCharValue" in r else ""
for r in row["Data"]
]
)
Expand Down
2 changes: 1 addition & 1 deletion moto/config/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ class InvalidResourceParameters(JsonRESTError):
def __init__(self) -> None:
super().__init__(
"ValidationException",
"Both Resource ID and Resource Name " "cannot be specified in the request",
"Both Resource ID and Resource Name cannot be specified in the request",
)


Expand Down
3 changes: 1 addition & 2 deletions moto/config/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,8 +571,7 @@ def __init__(
# A more specific message will be used here instead.
if not event_source:
raise MissingRequiredConfigRuleParameterException(
"Missing required parameter in ConfigRule.SourceDetails: "
"'EventSource'"
"Missing required parameter in ConfigRule.SourceDetails: 'EventSource'"
)
if event_source not in SourceDetail.EVENT_SOURCES:
raise ValidationException(
Expand Down
2 changes: 1 addition & 1 deletion moto/databrew/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def delete_recipe_version(self, recipe_name: str, recipe_version: str) -> None:
and float(recipe_version) not in recipe.versions
):
raise ResourceNotFoundException(
f"The recipe {recipe_name} version {recipe_version } wasn't found."
f"The recipe {recipe_name} version {recipe_version} wasn't found."
)

if recipe_version in (
Expand Down
2 changes: 1 addition & 1 deletion moto/ec2/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ class RulesPerSecurityGroupLimitExceededError(EC2ClientError):
def __init__(self) -> None:
super().__init__(
"RulesPerSecurityGroupLimitExceeded",
"The maximum number of rules per security group " "has been reached.",
"The maximum number of rules per security group has been reached.",
)


Expand Down
3 changes: 1 addition & 2 deletions moto/logs/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1181,8 +1181,7 @@ def put_subscription_filter(
else:
# TODO: support Kinesis stream destinations
raise InvalidParameterException(
f"Service '{service}' has not implemented for "
f"put_subscription_filter()"
f"Service '{service}' has not implemented for put_subscription_filter()"
)

log_group.put_subscription_filter(
Expand Down
3 changes: 1 addition & 2 deletions moto/route53resolver/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,8 +691,7 @@ def delete_resolver_rule(self, resolver_rule_id: str) -> ResolverRule:
]
if associations:
raise ResourceInUseException(
"Please disassociate this resolver rule from VPC first "
"before deleting"
"Please disassociate this resolver rule from VPC first before deleting"
)

self.tagger.delete_all_tags_for_resource(resolver_rule_id)
Expand Down
2 changes: 1 addition & 1 deletion moto/sagemaker/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3939,7 +3939,7 @@ def format_time(x: Any) -> str:
return (
x
if isinstance(x, str)
else datetime.fromtimestamp(x).strftime("%Y-%m-%d " "%H:%M:%S")
else datetime.fromtimestamp(x).strftime("%Y-%m-%d %H:%M:%S")
)

if created_after is not None:
Expand Down
2 changes: 1 addition & 1 deletion moto/secretsmanager/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ def rotate_secret(

if rotation_lambda_arn:
if len(rotation_lambda_arn) > 2048:
msg = "RotationLambdaARN " "must <= 2048 characters long."
msg = "RotationLambdaARN must <= 2048 characters long."
raise InvalidParameterException(msg)

if rotation_rules:
Expand Down
2 changes: 1 addition & 1 deletion moto/sqs/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class TooManyEntriesInBatchRequest(RESTError):
def __init__(self, number: int):
super().__init__(
"TooManyEntriesInBatchRequest",
"Maximum number of entries per request are 10. " f"You have sent {number}.",
f"Maximum number of entries per request are 10. You have sent {number}.",
)


Expand Down
3 changes: 1 addition & 2 deletions tests/test_ds/test_ds_simple_ad_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,7 @@ def test_ds_create_directory_bad_subnets():
err = exc.value.response["Error"]
assert err["Code"] == "ClientException"
assert (
"Invalid subnet ID(s). The two subnets must be in different "
"Availability Zones."
"Invalid subnet ID(s). The two subnets must be in different Availability Zones."
) in err["Message"]
ec2_client.delete_subnet(SubnetId=subnets_same_region[0])
ec2_client.delete_subnet(SubnetId=subnets_same_region[1])
Expand Down
4 changes: 1 addition & 3 deletions tests/test_dynamodb/test_dynamodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -2603,9 +2603,7 @@ def test_update_supports_complex_expression_attribute_values():
client.update_item(
TableName="TestTable",
Key={"SHA256": {"S": "sha-of-file"}},
UpdateExpression=(
"SET MD5 = :md5," "MyStringSet = :string_set," "MyMap = :map"
),
UpdateExpression=("SET MD5 = :md5,MyStringSet = :string_set,MyMap = :map"),
ExpressionAttributeValues={
":md5": {"S": "md5-of-file"},
":string_set": {"SS": ["string1", "string2"]},
Expand Down
2 changes: 1 addition & 1 deletion tests/test_s3/test_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -2271,7 +2271,7 @@ def test_put_bucket_cors():
err_value = err.value
assert err_value.response["Error"]["Code"] == "InvalidRequest"
assert err_value.response["Error"]["Message"] == (
"Found unsupported HTTP method in CORS config. " "Unsupported method is NOTREAL"
"Found unsupported HTTP method in CORS config. Unsupported method is NOTREAL"
)

with pytest.raises(ClientError) as err:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_ses/test_ses_boto3.py
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,7 @@ def test_create_ses_template():
assert result["Template"]["TemplateName"] == "MyTemplate"
assert result["Template"]["SubjectPart"] == "Greetings, {{name}}!"
assert result["Template"]["HtmlPart"] == (
"<h1>Hello {{name}}," "</h1><p>Your favorite animal is {{favoriteanimal}}.</p>"
"<h1>Hello {{name}},</h1><p>Your favorite animal is {{favoriteanimal}}.</p>"
)
# get a template which is not present
with pytest.raises(ClientError) as ex:
Expand Down

0 comments on commit 714f9fd

Please sign in to comment.