black linting

This commit is contained in:
Fabio Dias 2019-12-16 21:25:20 -05:00
commit 743dd46399
36 changed files with 383 additions and 154 deletions

View file

@ -20,7 +20,9 @@ SERVER_CRT = _GET_RESOURCE("star_moto_com.pem")
SERVER_COMMON_NAME = "*.moto.com"
SERVER_CRT_BAD = _GET_RESOURCE("star_moto_com-bad.pem")
SERVER_KEY = _GET_RESOURCE("star_moto_com.key")
BAD_ARN = "arn:aws:acm:us-east-2:{}:certificate/_0000000-0000-0000-0000-000000000000".format(ACCOUNT_ID)
BAD_ARN = "arn:aws:acm:us-east-2:{}:certificate/_0000000-0000-0000-0000-000000000000".format(
ACCOUNT_ID
)
def _import_cert(client):

View file

@ -882,7 +882,9 @@ def test_put_integration_validation():
client.put_integration(
restApiId=api_id,
resourceId=root_id,
credentials="arn:aws:iam::{}:role/service-role/testfunction-role-oe783psq".format(ACCOUNT_ID),
credentials="arn:aws:iam::{}:role/service-role/testfunction-role-oe783psq".format(
ACCOUNT_ID
),
httpMethod="GET",
type=type,
uri="arn:aws:apigateway:us-west-2:s3:path/b/k",
@ -904,7 +906,9 @@ def test_put_integration_validation():
client.put_integration(
restApiId=api_id,
resourceId=root_id,
credentials="arn:aws:iam::{}:role/service-role/testfunction-role-oe783psq".format(ACCOUNT_ID),
credentials="arn:aws:iam::{}:role/service-role/testfunction-role-oe783psq".format(
ACCOUNT_ID
),
httpMethod="GET",
type=type,
uri="arn:aws:apigateway:us-west-2:s3:path/b/k",

View file

@ -23,7 +23,9 @@ def test_create_launch_configuration():
security_groups=["default", "default2"],
user_data=b"This is some user_data",
instance_monitoring=True,
instance_profile_name="arn:aws:iam::{}:instance-profile/testing".format(ACCOUNT_ID),
instance_profile_name="arn:aws:iam::{}:instance-profile/testing".format(
ACCOUNT_ID
),
spot_price=0.1,
)
conn.create_launch_configuration(config)
@ -72,7 +74,9 @@ def test_create_launch_configuration_with_block_device_mappings():
security_groups=["default", "default2"],
user_data=b"This is some user_data",
instance_monitoring=True,
instance_profile_name="arn:aws:iam::{}:instance-profile/testing".format(ACCOUNT_ID),
instance_profile_name="arn:aws:iam::{}:instance-profile/testing".format(
ACCOUNT_ID
),
spot_price=0.1,
block_device_mappings=[block_device_mapping],
)

View file

@ -758,7 +758,8 @@ def test_tags_not_found():
).should.throw(botocore.client.ClientError)
conn.untag_resource.when.called_with(
Resource="arn:aws:lambda:{}:function:not-found".format(ACCOUNT_ID), TagKeys=["spam"]
Resource="arn:aws:lambda:{}:function:not-found".format(ACCOUNT_ID),
TagKeys=["spam"],
).should.throw(botocore.client.ClientError)
@ -921,18 +922,15 @@ def test_list_versions_by_function():
assert res["ResponseMetadata"]["HTTPStatusCode"] == 201
versions = conn.list_versions_by_function(FunctionName="testFunction")
assert len(versions["Versions"]) == 3
assert (
versions["Versions"][0]["FunctionArn"]
== "arn:aws:lambda:us-west-2:{}:function:testFunction:$LATEST".format(ACCOUNT_ID)
)
assert (
versions["Versions"][1]["FunctionArn"]
== "arn:aws:lambda:us-west-2:{}:function:testFunction:1".format(ACCOUNT_ID)
)
assert (
versions["Versions"][2]["FunctionArn"]
== "arn:aws:lambda:us-west-2:{}:function:testFunction:2".format(ACCOUNT_ID)
)
assert versions["Versions"][0][
"FunctionArn"
] == "arn:aws:lambda:us-west-2:{}:function:testFunction:$LATEST".format(ACCOUNT_ID)
assert versions["Versions"][1][
"FunctionArn"
] == "arn:aws:lambda:us-west-2:{}:function:testFunction:1".format(ACCOUNT_ID)
assert versions["Versions"][2][
"FunctionArn"
] == "arn:aws:lambda:us-west-2:{}:function:testFunction:2".format(ACCOUNT_ID)
conn.create_function(
FunctionName="testFunction_2",
@ -947,9 +945,10 @@ def test_list_versions_by_function():
)
versions = conn.list_versions_by_function(FunctionName="testFunction_2")
assert len(versions["Versions"]) == 1
assert (
versions["Versions"][0]["FunctionArn"]
== "arn:aws:lambda:us-west-2:{}:function:testFunction_2:$LATEST".format(ACCOUNT_ID)
assert versions["Versions"][0][
"FunctionArn"
] == "arn:aws:lambda:us-west-2:{}:function:testFunction_2:$LATEST".format(
ACCOUNT_ID
)

View file

@ -298,9 +298,7 @@ def test_boto3_list_stack_set_operation_results():
)
response["Summaries"].should.have.length_of(3)
response["Summaries"][0].should.have.key("Account").which.should.equal(
ACCOUNT_ID
)
response["Summaries"][0].should.have.key("Account").which.should.equal(ACCOUNT_ID)
response["Summaries"][1].should.have.key("Status").which.should.equal("STOPPED")

View file

@ -1934,7 +1934,9 @@ def test_stack_spot_fleet():
"SecurityGroups": [{"GroupId": "sg-123"}],
"SubnetId": subnet_id,
"IamInstanceProfile": {
"Arn": "arn:aws:iam::{}:role/fleet".format(ACCOUNT_ID)
"Arn": "arn:aws:iam::{}:role/fleet".format(
ACCOUNT_ID
)
},
"WeightedCapacity": "4",
"SpotPrice": "10.00",
@ -2019,7 +2021,9 @@ def test_stack_spot_fleet_should_figure_out_default_price():
"SecurityGroups": [{"GroupId": "sg-123"}],
"SubnetId": subnet_id,
"IamInstanceProfile": {
"Arn": "arn:aws:iam::{}:role/fleet".format(ACCOUNT_ID)
"Arn": "arn:aws:iam::{}:role/fleet".format(
ACCOUNT_ID
)
},
"WeightedCapacity": "4",
},

View file

@ -8,6 +8,7 @@ from moto import mock_cognitoidentity
from moto.cognitoidentity.utils import get_random_identity_id
from moto.core import ACCOUNT_ID
@mock_cognitoidentity
def test_create_identity_pool():
conn = boto3.client("cognito-identity", "us-west-2")
@ -17,7 +18,9 @@ def test_create_identity_pool():
AllowUnauthenticatedIdentities=False,
SupportedLoginProviders={"graph.facebook.com": "123456789012345"},
DeveloperProviderName="devname",
OpenIdConnectProviderARNs=["arn:aws:rds:eu-west-2:{}:db:mysql-db".format(ACCOUNT_ID)],
OpenIdConnectProviderARNs=[
"arn:aws:rds:eu-west-2:{}:db:mysql-db".format(ACCOUNT_ID)
],
CognitoIdentityProviders=[
{
"ProviderName": "testprovider",
@ -39,7 +42,9 @@ def test_describe_identity_pool():
AllowUnauthenticatedIdentities=False,
SupportedLoginProviders={"graph.facebook.com": "123456789012345"},
DeveloperProviderName="devname",
OpenIdConnectProviderARNs=["arn:aws:rds:eu-west-2:{}:db:mysql-db".format(ACCOUNT_ID)],
OpenIdConnectProviderARNs=[
"arn:aws:rds:eu-west-2:{}:db:mysql-db".format(ACCOUNT_ID)
],
CognitoIdentityProviders=[
{
"ProviderName": "testprovider",

View file

@ -133,7 +133,9 @@ def test_create_user_pool_domain_custom_domain_config():
domain = str(uuid.uuid4())
custom_domain_config = {
"CertificateArn": "arn:aws:acm:us-east-1:{}:certificate/123456789012".format(ACCOUNT_ID)
"CertificateArn": "arn:aws:acm:us-east-1:{}:certificate/123456789012".format(
ACCOUNT_ID
)
}
user_pool_id = conn.create_user_pool(PoolName=str(uuid.uuid4()))["UserPool"]["Id"]
result = conn.create_user_pool_domain(
@ -178,7 +180,9 @@ def test_update_user_pool_domain():
domain = str(uuid.uuid4())
custom_domain_config = {
"CertificateArn": "arn:aws:acm:us-east-1:{}:certificate/123456789012".format(ACCOUNT_ID)
"CertificateArn": "arn:aws:acm:us-east-1:{}:certificate/123456789012".format(
ACCOUNT_ID
)
}
user_pool_id = conn.create_user_pool(PoolName=str(uuid.uuid4()))["UserPool"]["Id"]
conn.create_user_pool_domain(UserPoolId=user_pool_id, Domain=domain)

View file

@ -9,6 +9,7 @@ from moto import mock_s3
from moto.config import mock_config
from moto.core import ACCOUNT_ID
@mock_config
def test_put_configuration_recorder():
client = boto3.client("config", region_name="us-west-2")
@ -397,7 +398,9 @@ def test_put_configuration_aggregator():
account_aggregation_source
]
assert (
"arn:aws:config:us-west-2:{}:config-aggregator/config-aggregator-".format(ACCOUNT_ID)
"arn:aws:config:us-west-2:{}:config-aggregator/config-aggregator-".format(
ACCOUNT_ID
)
in result["ConfigurationAggregator"]["ConfigurationAggregatorArn"]
)
assert (
@ -626,9 +629,10 @@ def test_put_aggregation_authorization():
Tags=[{"Key": "tag", "Value": "a"}],
)
assert (
result["AggregationAuthorization"]["AggregationAuthorizationArn"]
== "arn:aws:config:us-west-2:{}:aggregation-authorization/012345678910/us-east-1".format(ACCOUNT_ID)
assert result["AggregationAuthorization"][
"AggregationAuthorizationArn"
] == "arn:aws:config:us-west-2:{}:aggregation-authorization/012345678910/us-east-1".format(
ACCOUNT_ID
)
assert result["AggregationAuthorization"]["AuthorizedAccountId"] == "012345678910"
assert result["AggregationAuthorization"]["AuthorizedAwsRegion"] == "us-east-1"
@ -640,9 +644,10 @@ def test_put_aggregation_authorization():
result = client.put_aggregation_authorization(
AuthorizedAccountId="012345678910", AuthorizedAwsRegion="us-east-1"
)
assert (
result["AggregationAuthorization"]["AggregationAuthorizationArn"]
== "arn:aws:config:us-west-2:{}:aggregation-authorization/012345678910/us-east-1".format(ACCOUNT_ID)
assert result["AggregationAuthorization"][
"AggregationAuthorizationArn"
] == "arn:aws:config:us-west-2:{}:aggregation-authorization/012345678910/us-east-1".format(
ACCOUNT_ID
)
assert result["AggregationAuthorization"]["AuthorizedAccountId"] == "012345678910"
assert result["AggregationAuthorization"]["AuthorizedAwsRegion"] == "us-east-1"

View file

@ -46,7 +46,9 @@ def spot_config(subnet_id, allocation_strategy="lowestPrice"):
],
"Monitoring": {"Enabled": True},
"SubnetId": subnet_id,
"IamInstanceProfile": {"Arn": "arn:aws:iam::{}:role/fleet".format(ACCOUNT_ID)},
"IamInstanceProfile": {
"Arn": "arn:aws:iam::{}:role/fleet".format(ACCOUNT_ID)
},
"EbsOptimized": False,
"WeightedCapacity": 2.0,
"SpotPrice": "0.13",
@ -59,7 +61,9 @@ def spot_config(subnet_id, allocation_strategy="lowestPrice"):
"InstanceType": "t2.large",
"Monitoring": {"Enabled": True},
"SubnetId": subnet_id,
"IamInstanceProfile": {"Arn": "arn:aws:iam::{}:role/fleet".format(ACCOUNT_ID)},
"IamInstanceProfile": {
"Arn": "arn:aws:iam::{}:role/fleet".format(ACCOUNT_ID)
},
"EbsOptimized": False,
"WeightedCapacity": 4.0,
"SpotPrice": "10.00",

View file

@ -77,7 +77,12 @@ def test_create_load_balancer_with_certificate():
zones = ["us-east-1a"]
ports = [
(443, 8443, "https", "arn:aws:iam:{}:server-certificate/test-cert".format(ACCOUNT_ID))
(
443,
8443,
"https",
"arn:aws:iam:{}:server-certificate/test-cert".format(ACCOUNT_ID),
)
]
conn.create_load_balancer("my-lb", zones, ports)

View file

@ -347,7 +347,11 @@ def test_create_target_group_and_listeners():
Protocol="HTTPS",
Port=443,
Certificates=[
{"CertificateArn": "arn:aws:iam:{}:server-certificate/test-cert".format(ACCOUNT_ID)}
{
"CertificateArn": "arn:aws:iam:{}:server-certificate/test-cert".format(
ACCOUNT_ID
)
}
],
DefaultActions=[
{"Type": "forward", "TargetGroupArn": target_group.get("TargetGroupArn")}
@ -357,7 +361,13 @@ def test_create_target_group_and_listeners():
listener.get("Port").should.equal(443)
listener.get("Protocol").should.equal("HTTPS")
listener.get("Certificates").should.equal(
[{"CertificateArn": "arn:aws:iam:{}:server-certificate/test-cert".format(ACCOUNT_ID)}]
[
{
"CertificateArn": "arn:aws:iam:{}:server-certificate/test-cert".format(
ACCOUNT_ID
)
}
]
)
listener.get("DefaultActions").should.equal(
[{"TargetGroupArn": target_group.get("TargetGroupArn"), "Type": "forward"}]
@ -1903,7 +1913,9 @@ def test_cognito_action_listener_rule():
action = {
"Type": "authenticate-cognito",
"AuthenticateCognitoConfig": {
"UserPoolArn": "arn:aws:cognito-idp:us-east-1:{}:userpool/us-east-1_ABCD1234".format(ACCOUNT_ID),
"UserPoolArn": "arn:aws:cognito-idp:us-east-1:{}:userpool/us-east-1_ABCD1234".format(
ACCOUNT_ID
),
"UserPoolClientId": "abcd1234abcd",
"UserPoolDomain": "testpool",
},
@ -1978,7 +1990,9 @@ def test_cognito_action_listener_rule_cloudformation():
{
"Type": "authenticate-cognito",
"AuthenticateCognitoConfig": {
"UserPoolArn": "arn:aws:cognito-idp:us-east-1:{}:userpool/us-east-1_ABCD1234".format(ACCOUNT_ID),
"UserPoolArn": "arn:aws:cognito-idp:us-east-1:{}:userpool/us-east-1_ABCD1234".format(
ACCOUNT_ID
),
"UserPoolClientId": "abcd1234abcd",
"UserPoolDomain": "testpool",
},
@ -2007,7 +2021,9 @@ def test_cognito_action_listener_rule_cloudformation():
{
"Type": "authenticate-cognito",
"AuthenticateCognitoConfig": {
"UserPoolArn": "arn:aws:cognito-idp:us-east-1:{}:userpool/us-east-1_ABCD1234".format(ACCOUNT_ID),
"UserPoolArn": "arn:aws:cognito-idp:us-east-1:{}:userpool/us-east-1_ABCD1234".format(
ACCOUNT_ID
),
"UserPoolClientId": "abcd1234abcd",
"UserPoolDomain": "testpool",
},

View file

@ -342,7 +342,9 @@ def test_describe_event_bus():
"Effect": "Allow",
"Principal": {"AWS": "arn:aws:iam::111111111111:root"},
"Action": "events:PutEvents",
"Resource": "arn:aws:events:us-east-1:{}:event-bus/test-bus".format(ACCOUNT_ID),
"Resource": "arn:aws:events:us-east-1:{}:event-bus/test-bus".format(
ACCOUNT_ID
),
}
],
}
@ -373,23 +375,33 @@ def test_list_event_buses():
[
{
"Name": "default",
"Arn": "arn:aws:events:us-east-1:{}:event-bus/default".format(ACCOUNT_ID),
"Arn": "arn:aws:events:us-east-1:{}:event-bus/default".format(
ACCOUNT_ID
),
},
{
"Name": "other-bus-1",
"Arn": "arn:aws:events:us-east-1:{}:event-bus/other-bus-1".format(ACCOUNT_ID),
"Arn": "arn:aws:events:us-east-1:{}:event-bus/other-bus-1".format(
ACCOUNT_ID
),
},
{
"Name": "other-bus-2",
"Arn": "arn:aws:events:us-east-1:{}:event-bus/other-bus-2".format(ACCOUNT_ID),
"Arn": "arn:aws:events:us-east-1:{}:event-bus/other-bus-2".format(
ACCOUNT_ID
),
},
{
"Name": "test-bus-1",
"Arn": "arn:aws:events:us-east-1:{}:event-bus/test-bus-1".format(ACCOUNT_ID),
"Arn": "arn:aws:events:us-east-1:{}:event-bus/test-bus-1".format(
ACCOUNT_ID
),
},
{
"Name": "test-bus-2",
"Arn": "arn:aws:events:us-east-1:{}:event-bus/test-bus-2".format(ACCOUNT_ID),
"Arn": "arn:aws:events:us-east-1:{}:event-bus/test-bus-2".format(
ACCOUNT_ID
),
},
]
)
@ -401,11 +413,15 @@ def test_list_event_buses():
[
{
"Name": "other-bus-1",
"Arn": "arn:aws:events:us-east-1:{}:event-bus/other-bus-1".format(ACCOUNT_ID),
"Arn": "arn:aws:events:us-east-1:{}:event-bus/other-bus-1".format(
ACCOUNT_ID
),
},
{
"Name": "other-bus-2",
"Arn": "arn:aws:events:us-east-1:{}:event-bus/other-bus-2".format(ACCOUNT_ID),
"Arn": "arn:aws:events:us-east-1:{}:event-bus/other-bus-2".format(
ACCOUNT_ID
),
},
]
)
@ -427,7 +443,9 @@ def test_delete_event_bus():
[
{
"Name": "default",
"Arn": "arn:aws:events:us-east-1:{}:event-bus/default".format(ACCOUNT_ID),
"Arn": "arn:aws:events:us-east-1:{}:event-bus/default".format(
ACCOUNT_ID
),
}
]
)

View file

@ -84,7 +84,9 @@ def test_get_all_server_certs():
certs.should.have.length_of(1)
cert1 = certs[0]
cert1.server_certificate_name.should.equal("certname")
cert1.arn.should.equal("arn:aws:iam::{}:server-certificate/certname".format(ACCOUNT_ID))
cert1.arn.should.equal(
"arn:aws:iam::{}:server-certificate/certname".format(ACCOUNT_ID)
)
@mock_iam_deprecated()
@ -102,7 +104,9 @@ def test_get_server_cert():
conn.upload_server_cert("certname", "certbody", "privatekey")
cert = conn.get_server_certificate("certname")
cert.server_certificate_name.should.equal("certname")
cert.arn.should.equal("arn:aws:iam::{}:server-certificate/certname".format(ACCOUNT_ID))
cert.arn.should.equal(
"arn:aws:iam::{}:server-certificate/certname".format(ACCOUNT_ID)
)
@mock_iam_deprecated()
@ -112,7 +116,9 @@ def test_upload_server_cert():
conn.upload_server_cert("certname", "certbody", "privatekey")
cert = conn.get_server_certificate("certname")
cert.server_certificate_name.should.equal("certname")
cert.arn.should.equal("arn:aws:iam::{}:server-certificate/certname".format(ACCOUNT_ID))
cert.arn.should.equal(
"arn:aws:iam::{}:server-certificate/certname".format(ACCOUNT_ID)
)
@mock_iam_deprecated()
@ -443,7 +449,9 @@ def test_create_policy_versions():
conn = boto3.client("iam", region_name="us-east-1")
with assert_raises(ClientError):
conn.create_policy_version(
PolicyArn="arn:aws:iam::{}:policy/TestCreatePolicyVersion".format(ACCOUNT_ID),
PolicyArn="arn:aws:iam::{}:policy/TestCreatePolicyVersion".format(
ACCOUNT_ID
),
PolicyDocument='{"some":"policy"}',
)
conn.create_policy(PolicyName="TestCreatePolicyVersion", PolicyDocument=MOCK_POLICY)
@ -475,12 +483,16 @@ def test_create_many_policy_versions():
)
for _ in range(0, 4):
conn.create_policy_version(
PolicyArn="arn:aws:iam::{}:policy/TestCreateManyPolicyVersions".format(ACCOUNT_ID),
PolicyArn="arn:aws:iam::{}:policy/TestCreateManyPolicyVersions".format(
ACCOUNT_ID
),
PolicyDocument=MOCK_POLICY,
)
with assert_raises(ClientError):
conn.create_policy_version(
PolicyArn="arn:aws:iam::{}:policy/TestCreateManyPolicyVersions".format(ACCOUNT_ID),
PolicyArn="arn:aws:iam::{}:policy/TestCreateManyPolicyVersions".format(
ACCOUNT_ID
),
PolicyDocument=MOCK_POLICY,
)
@ -492,17 +504,23 @@ def test_set_default_policy_version():
PolicyName="TestSetDefaultPolicyVersion", PolicyDocument=MOCK_POLICY
)
conn.create_policy_version(
PolicyArn="arn:aws:iam::{}:policy/TestSetDefaultPolicyVersion".format(ACCOUNT_ID),
PolicyArn="arn:aws:iam::{}:policy/TestSetDefaultPolicyVersion".format(
ACCOUNT_ID
),
PolicyDocument=MOCK_POLICY_2,
SetAsDefault=True,
)
conn.create_policy_version(
PolicyArn="arn:aws:iam::{}:policy/TestSetDefaultPolicyVersion".format(ACCOUNT_ID),
PolicyArn="arn:aws:iam::{}:policy/TestSetDefaultPolicyVersion".format(
ACCOUNT_ID
),
PolicyDocument=MOCK_POLICY_3,
SetAsDefault=True,
)
versions = conn.list_policy_versions(
PolicyArn="arn:aws:iam::{}:policy/TestSetDefaultPolicyVersion".format(ACCOUNT_ID)
PolicyArn="arn:aws:iam::{}:policy/TestSetDefaultPolicyVersion".format(
ACCOUNT_ID
)
)
versions.get("Versions")[0].get("Document").should.equal(json.loads(MOCK_POLICY))
versions.get("Versions")[0].get("IsDefaultVersion").shouldnt.be.ok
@ -518,7 +536,9 @@ def test_get_policy():
response = conn.create_policy(
PolicyName="TestGetPolicy", PolicyDocument=MOCK_POLICY
)
policy = conn.get_policy(PolicyArn="arn:aws:iam::{}:policy/TestGetPolicy".format(ACCOUNT_ID))
policy = conn.get_policy(
PolicyArn="arn:aws:iam::{}:policy/TestGetPolicy".format(ACCOUNT_ID)
)
policy["Policy"]["Arn"].should.equal(
"arn:aws:iam::{}:policy/TestGetPolicy".format(ACCOUNT_ID)
)
@ -638,7 +658,9 @@ def test_delete_policy_version():
)
with assert_raises(ClientError):
conn.delete_policy_version(
PolicyArn="arn:aws:iam::{}:policy/TestDeletePolicyVersion".format(ACCOUNT_ID),
PolicyArn="arn:aws:iam::{}:policy/TestDeletePolicyVersion".format(
ACCOUNT_ID
),
VersionId="v2-nope-this-does-not-exist",
)
conn.delete_policy_version(
@ -661,7 +683,9 @@ def test_delete_default_policy_version():
)
with assert_raises(ClientError):
conn.delete_policy_version(
PolicyArn="arn:aws:iam::{}:policy/TestDeletePolicyVersion".format(ACCOUNT_ID),
PolicyArn="arn:aws:iam::{}:policy/TestDeletePolicyVersion".format(
ACCOUNT_ID
),
VersionId="v1",
)
@ -840,7 +864,9 @@ def test_create_virtual_mfa_device():
response = client.create_virtual_mfa_device(VirtualMFADeviceName="test-device")
device = response["VirtualMFADevice"]
device["SerialNumber"].should.equal("arn:aws:iam::{}:mfa/test-device".format(ACCOUNT_ID))
device["SerialNumber"].should.equal(
"arn:aws:iam::{}:mfa/test-device".format(ACCOUNT_ID)
)
device["Base32StringSeed"].decode("ascii").should.match("[A-Z234567]")
device["QRCodePNG"].should_not.be.empty
@ -849,7 +875,9 @@ def test_create_virtual_mfa_device():
)
device = response["VirtualMFADevice"]
device["SerialNumber"].should.equal("arn:aws:iam::{}:mfa/test-device-2".format(ACCOUNT_ID))
device["SerialNumber"].should.equal(
"arn:aws:iam::{}:mfa/test-device-2".format(ACCOUNT_ID)
)
device["Base32StringSeed"].decode("ascii").should.match("[A-Z234567]")
device["QRCodePNG"].should_not.be.empty
@ -1010,7 +1038,9 @@ def test_enable_virtual_mfa_device():
device["User"]["Path"].should.equal("/")
device["User"]["UserName"].should.equal("test-user")
device["User"]["UserId"].should_not.be.empty
device["User"]["Arn"].should.equal("arn:aws:iam::{}:user/test-user".format(ACCOUNT_ID))
device["User"]["Arn"].should.equal(
"arn:aws:iam::{}:user/test-user".format(ACCOUNT_ID)
)
device["User"]["CreateDate"].should.be.a(datetime)
device["EnableDate"].should.be.a(datetime)
response["IsTruncated"].should_not.be.ok
@ -1471,10 +1501,12 @@ def test_get_account_authorization_details():
)
conn.attach_user_policy(
UserName="testUser", PolicyArn="arn:aws:iam::{}:policy/testPolicy".format(ACCOUNT_ID)
UserName="testUser",
PolicyArn="arn:aws:iam::{}:policy/testPolicy".format(ACCOUNT_ID),
)
conn.attach_group_policy(
GroupName="testGroup", PolicyArn="arn:aws:iam::{}:policy/testPolicy".format(ACCOUNT_ID)
GroupName="testGroup",
PolicyArn="arn:aws:iam::{}:policy/testPolicy".format(ACCOUNT_ID),
)
conn.add_user_to_group(UserName="testUser", GroupName="testGroup")
@ -1493,7 +1525,8 @@ def test_get_account_authorization_details():
RoleName="my-role", PolicyName="test-policy", PolicyDocument=test_policy
)
conn.attach_role_policy(
RoleName="my-role", PolicyArn="arn:aws:iam::{}:policy/testPolicy".format(ACCOUNT_ID)
RoleName="my-role",
PolicyArn="arn:aws:iam::{}:policy/testPolicy".format(ACCOUNT_ID),
)
result = conn.get_account_authorization_details(Filter=["Role"])
@ -1519,10 +1552,9 @@ def test_get_account_authorization_details():
result["RoleDetailList"][0]["AttachedManagedPolicies"][0]["PolicyName"]
== "testPolicy"
)
assert (
result["RoleDetailList"][0]["AttachedManagedPolicies"][0]["PolicyArn"]
== "arn:aws:iam::{}:policy/testPolicy".format(ACCOUNT_ID)
)
assert result["RoleDetailList"][0]["AttachedManagedPolicies"][0][
"PolicyArn"
] == "arn:aws:iam::{}:policy/testPolicy".format(ACCOUNT_ID)
result = conn.get_account_authorization_details(Filter=["User"])
assert len(result["RoleDetailList"]) == 0
@ -1535,10 +1567,9 @@ def test_get_account_authorization_details():
result["UserDetailList"][0]["AttachedManagedPolicies"][0]["PolicyName"]
== "testPolicy"
)
assert (
result["UserDetailList"][0]["AttachedManagedPolicies"][0]["PolicyArn"]
== "arn:aws:iam::{}:policy/testPolicy".format(ACCOUNT_ID)
)
assert result["UserDetailList"][0]["AttachedManagedPolicies"][0][
"PolicyArn"
] == "arn:aws:iam::{}:policy/testPolicy".format(ACCOUNT_ID)
result = conn.get_account_authorization_details(Filter=["Group"])
assert len(result["RoleDetailList"]) == 0
@ -1551,10 +1582,9 @@ def test_get_account_authorization_details():
result["GroupDetailList"][0]["AttachedManagedPolicies"][0]["PolicyName"]
== "testPolicy"
)
assert (
result["GroupDetailList"][0]["AttachedManagedPolicies"][0]["PolicyArn"]
== "arn:aws:iam::{}:policy/testPolicy".format(ACCOUNT_ID)
)
assert result["GroupDetailList"][0]["AttachedManagedPolicies"][0][
"PolicyArn"
] == "arn:aws:iam::{}:policy/testPolicy".format(ACCOUNT_ID)
result = conn.get_account_authorization_details(Filter=["LocalManagedPolicy"])
assert len(result["RoleDetailList"]) == 0
@ -2115,10 +2145,12 @@ def test_list_entities_for_policy():
)
conn.attach_user_policy(
UserName="testUser", PolicyArn="arn:aws:iam::{}:policy/testPolicy".format(ACCOUNT_ID)
UserName="testUser",
PolicyArn="arn:aws:iam::{}:policy/testPolicy".format(ACCOUNT_ID),
)
conn.attach_group_policy(
GroupName="testGroup", PolicyArn="arn:aws:iam::{}:policy/testPolicy".format(ACCOUNT_ID)
GroupName="testGroup",
PolicyArn="arn:aws:iam::{}:policy/testPolicy".format(ACCOUNT_ID),
)
conn.add_user_to_group(UserName="testUser", GroupName="testGroup")
@ -2137,21 +2169,25 @@ def test_list_entities_for_policy():
RoleName="my-role", PolicyName="test-policy", PolicyDocument=test_policy
)
conn.attach_role_policy(
RoleName="my-role", PolicyArn="arn:aws:iam::{}:policy/testPolicy".format(ACCOUNT_ID)
RoleName="my-role",
PolicyArn="arn:aws:iam::{}:policy/testPolicy".format(ACCOUNT_ID),
)
response = conn.list_entities_for_policy(
PolicyArn="arn:aws:iam::{}:policy/testPolicy".format(ACCOUNT_ID), EntityFilter="Role"
PolicyArn="arn:aws:iam::{}:policy/testPolicy".format(ACCOUNT_ID),
EntityFilter="Role",
)
assert response["PolicyRoles"] == [{"RoleName": "my-role"}]
response = conn.list_entities_for_policy(
PolicyArn="arn:aws:iam::{}:policy/testPolicy".format(ACCOUNT_ID), EntityFilter="User"
PolicyArn="arn:aws:iam::{}:policy/testPolicy".format(ACCOUNT_ID),
EntityFilter="User",
)
assert response["PolicyUsers"] == [{"UserName": "testUser"}]
response = conn.list_entities_for_policy(
PolicyArn="arn:aws:iam::{}:policy/testPolicy".format(ACCOUNT_ID), EntityFilter="Group"
PolicyArn="arn:aws:iam::{}:policy/testPolicy".format(ACCOUNT_ID),
EntityFilter="Group",
)
assert response["PolicyGroups"] == [{"GroupName": "testGroup"}]
@ -2170,7 +2206,9 @@ def test_create_role_no_path():
resp = conn.create_role(
RoleName="my-role", AssumeRolePolicyDocument="some policy", Description="test"
)
resp.get("Role").get("Arn").should.equal("arn:aws:iam::{}:role/my-role".format(ACCOUNT_ID))
resp.get("Role").get("Arn").should.equal(
"arn:aws:iam::{}:role/my-role".format(ACCOUNT_ID)
)
resp.get("Role").should_not.have.key("PermissionsBoundary")
resp.get("Role").get("Description").should.equal("test")

View file

@ -58,10 +58,9 @@ def test_get_group_current():
# Make a group with a different path:
other_group = conn.create_group(GroupName="my-other-group", Path="some/location")
assert other_group["Group"]["Path"] == "some/location"
assert (
other_group["Group"]["Arn"]
== "arn:aws:iam::{}:group/some/location/my-other-group".format(ACCOUNT_ID)
)
assert other_group["Group"][
"Arn"
] == "arn:aws:iam::{}:group/some/location/my-other-group".format(ACCOUNT_ID)
@mock_iam_deprecated()

View file

@ -27,7 +27,9 @@ def create_s3_delivery_stream(client, stream_name):
},
"SchemaConfiguration": {
"DatabaseName": stream_name,
"RoleARN": "arn:aws:iam::{}:role/firehose_delivery_role".format(ACCOUNT_ID),
"RoleARN": "arn:aws:iam::{}:role/firehose_delivery_role".format(
ACCOUNT_ID
),
"TableName": "outputTable",
},
},
@ -48,7 +50,9 @@ def create_redshift_delivery_stream(client, stream_name):
"Username": "username",
"Password": "password",
"S3Configuration": {
"RoleARN": "arn:aws:iam::{}:role/firehose_delivery_role".format(ACCOUNT_ID),
"RoleARN": "arn:aws:iam::{}:role/firehose_delivery_role".format(
ACCOUNT_ID
),
"BucketARN": "arn:aws:s3:::kinesis-test",
"Prefix": "myFolder/",
"BufferingHints": {"SizeInMBs": 123, "IntervalInSeconds": 124},
@ -82,7 +86,9 @@ def test_create_redshift_delivery_stream():
{
"DestinationId": "string",
"RedshiftDestinationDescription": {
"RoleARN": "arn:aws:iam::{}:role/firehose_delivery_role".format(ACCOUNT_ID),
"RoleARN": "arn:aws:iam::{}:role/firehose_delivery_role".format(
ACCOUNT_ID
),
"ClusterJDBCURL": "jdbc:redshift://host.amazonaws.com:5439/database",
"CopyCommand": {
"DataTableName": "outputTable",
@ -90,7 +96,9 @@ def test_create_redshift_delivery_stream():
},
"Username": "username",
"S3DestinationDescription": {
"RoleARN": "arn:aws:iam::{}:role/firehose_delivery_role".format(ACCOUNT_ID),
"RoleARN": "arn:aws:iam::{}:role/firehose_delivery_role".format(
ACCOUNT_ID
),
"BucketARN": "arn:aws:s3:::kinesis-test",
"Prefix": "myFolder/",
"BufferingHints": {
@ -131,7 +139,9 @@ def test_create_s3_delivery_stream():
{
"DestinationId": "string",
"ExtendedS3DestinationDescription": {
"RoleARN": "arn:aws:iam::{}:role/firehose_delivery_role".format(ACCOUNT_ID),
"RoleARN": "arn:aws:iam::{}:role/firehose_delivery_role".format(
ACCOUNT_ID
),
"BucketARN": "arn:aws:s3:::kinesis-test",
"Prefix": "myFolder/",
"CompressionFormat": "UNCOMPRESSED",
@ -147,7 +157,9 @@ def test_create_s3_delivery_stream():
},
"SchemaConfiguration": {
"DatabaseName": "stream1",
"RoleARN": "arn:aws:iam::{}:role/firehose_delivery_role".format(ACCOUNT_ID),
"RoleARN": "arn:aws:iam::{}:role/firehose_delivery_role".format(
ACCOUNT_ID
),
"TableName": "outputTable",
},
},
@ -192,8 +204,12 @@ def test_create_stream_without_redshift():
{
"DestinationId": "string",
"S3DestinationDescription": {
"RoleARN": "arn:aws:iam::{}:role/firehose_delivery_role".format(ACCOUNT_ID),
"RoleARN": "arn:aws:iam::{}:role/firehose_delivery_role".format(ACCOUNT_ID),
"RoleARN": "arn:aws:iam::{}:role/firehose_delivery_role".format(
ACCOUNT_ID
),
"RoleARN": "arn:aws:iam::{}:role/firehose_delivery_role".format(
ACCOUNT_ID
),
"BucketARN": "arn:aws:s3:::kinesis-test",
"Prefix": "myFolder/",
"BufferingHints": {"SizeInMBs": 123, "IntervalInSeconds": 124},

View file

@ -22,7 +22,9 @@ def test_create_cluster():
stream = stream_response["StreamDescription"]
stream["StreamName"].should.equal("my_stream")
stream["HasMoreShards"].should.equal(False)
stream["StreamARN"].should.equal("arn:aws:kinesis:us-west-2:{}:my_stream".format(ACCOUNT_ID))
stream["StreamARN"].should.equal(
"arn:aws:kinesis:us-west-2:{}:my_stream".format(ACCOUNT_ID)
)
stream["StreamStatus"].should.equal("ACTIVE")
shards = stream["Shards"]

View file

@ -20,6 +20,7 @@ from moto import mock_redshift
from moto import mock_redshift_deprecated
from moto.core import ACCOUNT_ID
@mock_redshift
def test_create_cluster_boto3():
client = boto3.client("redshift", region_name="us-east-1")
@ -1044,7 +1045,9 @@ def test_describe_tags_with_resource_type():
@mock_redshift
def test_describe_tags_cannot_specify_resource_type_and_resource_name():
client = boto3.client("redshift", region_name="us-east-1")
resource_name = "arn:aws:redshift:us-east-1:{}:cluster:cluster-id".format(ACCOUNT_ID)
resource_name = "arn:aws:redshift:us-east-1:{}:cluster:cluster-id".format(
ACCOUNT_ID
)
resource_type = "cluster"
client.describe_tags.when.called_with(
ResourceName=resource_name, ResourceType=resource_type

View file

@ -9,7 +9,13 @@ import sure # noqa
from moto import mock_sns_deprecated, mock_sqs_deprecated
from moto.core import ACCOUNT_ID
MESSAGE_FROM_SQS_TEMPLATE = '{\n "Message": "%s",\n "MessageId": "%s",\n "Signature": "EXAMPLElDMXvB8r9R83tGoNn0ecwd5UjllzsvSvbItzfaMpN2nk5HVSw7XnOn/49IkxDKz8YrlH2qJXj2iZB0Zo2O71c4qQk1fMUDi3LGpij7RCW7AW9vYYsSqIKRnFS94ilu7NFhUzLiieYr4BKHpdTmdD6c0esKEYBpabxDSc=",\n "SignatureVersion": "1",\n "SigningCertURL": "https://sns.us-east-1.amazonaws.com/SimpleNotificationService-f3ecfb7224c7233fe7bb5f59f96de52f.pem",\n "Subject": "%s",\n "Timestamp": "2015-01-01T12:00:00.000Z",\n "TopicArn": "arn:aws:sns:%s:'+ACCOUNT_ID+':some-topic",\n "Type": "Notification",\n "UnsubscribeURL": "https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-1:'+ACCOUNT_ID+':some-topic:2bcfbf39-05c3-41de-beaa-fcfcc21c8f55"\n}'
MESSAGE_FROM_SQS_TEMPLATE = (
'{\n "Message": "%s",\n "MessageId": "%s",\n "Signature": "EXAMPLElDMXvB8r9R83tGoNn0ecwd5UjllzsvSvbItzfaMpN2nk5HVSw7XnOn/49IkxDKz8YrlH2qJXj2iZB0Zo2O71c4qQk1fMUDi3LGpij7RCW7AW9vYYsSqIKRnFS94ilu7NFhUzLiieYr4BKHpdTmdD6c0esKEYBpabxDSc=",\n "SignatureVersion": "1",\n "SigningCertURL": "https://sns.us-east-1.amazonaws.com/SimpleNotificationService-f3ecfb7224c7233fe7bb5f59f96de52f.pem",\n "Subject": "%s",\n "Timestamp": "2015-01-01T12:00:00.000Z",\n "TopicArn": "arn:aws:sns:%s:'
+ ACCOUNT_ID
+ ':some-topic",\n "Type": "Notification",\n "UnsubscribeURL": "https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-1:'
+ ACCOUNT_ID
+ ':some-topic:2bcfbf39-05c3-41de-beaa-fcfcc21c8f55"\n}'
)
@mock_sqs_deprecated
@ -25,7 +31,9 @@ def test_publish_to_sqs():
sqs_conn = boto.connect_sqs()
sqs_conn.create_queue("test-queue")
conn.subscribe(topic_arn, "sqs", "arn:aws:sqs:us-east-1:{}:test-queue".format(ACCOUNT_ID))
conn.subscribe(
topic_arn, "sqs", "arn:aws:sqs:us-east-1:{}:test-queue".format(ACCOUNT_ID)
)
message_to_publish = "my message"
subject_to_publish = "test subject"
@ -66,7 +74,9 @@ def test_publish_to_sqs_in_different_region():
sqs_conn = boto.sqs.connect_to_region("us-west-2")
sqs_conn.create_queue("test-queue")
conn.subscribe(topic_arn, "sqs", "arn:aws:sqs:us-west-2:{}:test-queue".format(ACCOUNT_ID))
conn.subscribe(
topic_arn, "sqs", "arn:aws:sqs:us-west-2:{}:test-queue".format(ACCOUNT_ID)
)
message_to_publish = "my message"
subject_to_publish = "test subject"

View file

@ -14,7 +14,13 @@ from nose.tools import assert_raises
from moto import mock_sns, mock_sqs
from moto.core import ACCOUNT_ID
MESSAGE_FROM_SQS_TEMPLATE = '{\n "Message": "%s",\n "MessageId": "%s",\n "Signature": "EXAMPLElDMXvB8r9R83tGoNn0ecwd5UjllzsvSvbItzfaMpN2nk5HVSw7XnOn/49IkxDKz8YrlH2qJXj2iZB0Zo2O71c4qQk1fMUDi3LGpij7RCW7AW9vYYsSqIKRnFS94ilu7NFhUzLiieYr4BKHpdTmdD6c0esKEYBpabxDSc=",\n "SignatureVersion": "1",\n "SigningCertURL": "https://sns.us-east-1.amazonaws.com/SimpleNotificationService-f3ecfb7224c7233fe7bb5f59f96de52f.pem",\n "Subject": "my subject",\n "Timestamp": "2015-01-01T12:00:00.000Z",\n "TopicArn": "arn:aws:sns:%s:'+ACCOUNT_ID+':some-topic",\n "Type": "Notification",\n "UnsubscribeURL": "https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-1:'+ACCOUNT_ID+':some-topic:2bcfbf39-05c3-41de-beaa-fcfcc21c8f55"\n}'
MESSAGE_FROM_SQS_TEMPLATE = (
'{\n "Message": "%s",\n "MessageId": "%s",\n "Signature": "EXAMPLElDMXvB8r9R83tGoNn0ecwd5UjllzsvSvbItzfaMpN2nk5HVSw7XnOn/49IkxDKz8YrlH2qJXj2iZB0Zo2O71c4qQk1fMUDi3LGpij7RCW7AW9vYYsSqIKRnFS94ilu7NFhUzLiieYr4BKHpdTmdD6c0esKEYBpabxDSc=",\n "SignatureVersion": "1",\n "SigningCertURL": "https://sns.us-east-1.amazonaws.com/SimpleNotificationService-f3ecfb7224c7233fe7bb5f59f96de52f.pem",\n "Subject": "my subject",\n "Timestamp": "2015-01-01T12:00:00.000Z",\n "TopicArn": "arn:aws:sns:%s:'
+ ACCOUNT_ID
+ ':some-topic",\n "Type": "Notification",\n "UnsubscribeURL": "https://sns.us-east-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:us-east-1:'
+ ACCOUNT_ID
+ ':some-topic:2bcfbf39-05c3-41de-beaa-fcfcc21c8f55"\n}'
)
@mock_sqs

View file

@ -59,7 +59,9 @@ def test_topic_corresponds_to_region():
topic_arn = topics_json["ListTopicsResponse"]["ListTopicsResult"]["Topics"][0][
"TopicArn"
]
topic_arn.should.equal("arn:aws:sns:{0}:{1}:some-topic".format(region, ACCOUNT_ID))
topic_arn.should.equal(
"arn:aws:sns:{0}:{1}:some-topic".format(region, ACCOUNT_ID)
)
@mock_sns_deprecated
@ -99,7 +101,9 @@ def test_topic_attributes():
"SNS:Publish",
"SNS:Receive",
],
"Resource": "arn:aws:sns:us-east-1:{}:some-topic".format(ACCOUNT_ID),
"Resource": "arn:aws:sns:us-east-1:{}:some-topic".format(
ACCOUNT_ID
),
"Condition": {"StringEquals": {"AWS:SourceOwner": ACCOUNT_ID}},
}
],

View file

@ -10,6 +10,7 @@ from moto import mock_sns
from moto.sns.models import DEFAULT_EFFECTIVE_DELIVERY_POLICY, DEFAULT_PAGE_SIZE
from moto.core import ACCOUNT_ID
@mock_sns
def test_create_and_delete_topic():
conn = boto3.client("sns", region_name="us-east-1")
@ -132,7 +133,9 @@ def test_topic_corresponds_to_region():
conn.create_topic(Name="some-topic")
topics_json = conn.list_topics()
topic_arn = topics_json["Topics"][0]["TopicArn"]
topic_arn.should.equal("arn:aws:sns:{0}:{1}:some-topic".format(region, ACCOUNT_ID))
topic_arn.should.equal(
"arn:aws:sns:{0}:{1}:some-topic".format(region, ACCOUNT_ID)
)
@mock_sns
@ -170,7 +173,9 @@ def test_topic_attributes():
"SNS:Publish",
"SNS:Receive",
],
"Resource": "arn:aws:sns:us-east-1:{}:some-topic".format(ACCOUNT_ID),
"Resource": "arn:aws:sns:us-east-1:{}:some-topic".format(
ACCOUNT_ID
),
"Condition": {"StringEquals": {"AWS:SourceOwner": ACCOUNT_ID}},
}
],
@ -271,7 +276,9 @@ def test_add_remove_permissions():
"SNS:Publish",
"SNS:Receive",
],
"Resource": "arn:aws:sns:us-east-1:{}:test-permissions".format(ACCOUNT_ID),
"Resource": "arn:aws:sns:us-east-1:{}:test-permissions".format(
ACCOUNT_ID
),
"Condition": {"StringEquals": {"AWS:SourceOwner": ACCOUNT_ID}},
},
{
@ -279,7 +286,9 @@ def test_add_remove_permissions():
"Effect": "Allow",
"Principal": {"AWS": "arn:aws:iam::999999999999:root"},
"Action": "SNS:Publish",
"Resource": "arn:aws:sns:us-east-1:{}:test-permissions".format(ACCOUNT_ID),
"Resource": "arn:aws:sns:us-east-1:{}:test-permissions".format(
ACCOUNT_ID
),
},
],
}
@ -308,7 +317,9 @@ def test_add_remove_permissions():
"SNS:Publish",
"SNS:Receive",
],
"Resource": "arn:aws:sns:us-east-1:{}:test-permissions".format(ACCOUNT_ID),
"Resource": "arn:aws:sns:us-east-1:{}:test-permissions".format(
ACCOUNT_ID
),
"Condition": {"StringEquals": {"AWS:SourceOwner": ACCOUNT_ID}},
}
],

View file

@ -23,6 +23,7 @@ from nose.tools import assert_raises
from tests.helpers import requires_boto_gte
from moto.core import ACCOUNT_ID
@mock_sqs
def test_create_fifo_queue_fail():
sqs = boto3.client("sqs", region_name="us-east-1")
@ -283,7 +284,7 @@ def test_create_queues_in_multiple_region():
base_url = "https://us-west-1.queue.amazonaws.com"
west1_conn.list_queues()["QueueUrls"][0].should.equal(
"{base_url}/{AccountId}/blah".format(base_url=base_url,AccountId=ACCOUNT_ID)
"{base_url}/{AccountId}/blah".format(base_url=base_url, AccountId=ACCOUNT_ID)
)
@ -305,7 +306,9 @@ def test_get_queue_with_prefix():
base_url = "https://us-west-1.queue.amazonaws.com"
queue[0].should.equal(
"{base_url}/{AccountId}/test-queue".format(base_url=base_url, AccountId=ACCOUNT_ID)
"{base_url}/{AccountId}/test-queue".format(
base_url=base_url, AccountId=ACCOUNT_ID
)
)
@ -851,7 +854,9 @@ def test_queue_attributes():
attributes = queue.get_attributes()
attributes["QueueArn"].should.look_like(
"arn:aws:sqs:us-east-1:{AccountId}:{name}".format(AccountId=ACCOUNT_ID,name=queue_name)
"arn:aws:sqs:us-east-1:{AccountId}:{name}".format(
AccountId=ACCOUNT_ID, name=queue_name
)
)
attributes["VisibilityTimeout"].should.look_like(str(visibility_timeout))

View file

@ -34,7 +34,7 @@ def test_state_machine_creation_succeeds():
response["ResponseMetadata"]["HTTPStatusCode"].should.equal(200)
response["creationDate"].should.be.a(datetime)
response["stateMachineArn"].should.equal(
"arn:aws:states:" + region + ":"+ACCOUNT_ID+":stateMachine:" + name
"arn:aws:states:" + region + ":" + ACCOUNT_ID + ":stateMachine:" + name
)
@ -286,7 +286,7 @@ def test_state_machine_can_deleted_nonexisting_machine():
client = boto3.client("stepfunctions", region_name=region)
#
unknown_state_machine = (
"arn:aws:states:" + region + ":"+ACCOUNT_ID+":stateMachine:unknown"
"arn:aws:states:" + region + ":" + ACCOUNT_ID + ":stateMachine:unknown"
)
response = client.delete_state_machine(stateMachineArn=unknown_state_machine)
response["ResponseMetadata"]["HTTPStatusCode"].should.equal(200)