diff --git a/moto/secretsmanager/utils.py b/moto/secretsmanager/utils.py index cc2d6ce8a..73275ee05 100644 --- a/moto/secretsmanager/utils.py +++ b/moto/secretsmanager/utils.py @@ -81,7 +81,7 @@ def get_secret_name_from_arn(secret_id): # split the arn by colon # then get the last value which is the name appended with a random string # then remove the random string - secret_id = '-'.join(secret_id.split(':')[-1].split('-')[:-1]) + secret_id = "-".join(secret_id.split(":")[-1].split("-")[:-1]) return secret_id diff --git a/tests/test_secretsmanager/test_secretsmanager.py b/tests/test_secretsmanager/test_secretsmanager.py index 4d880604d..3b8c74e81 100644 --- a/tests/test_secretsmanager/test_secretsmanager.py +++ b/tests/test_secretsmanager/test_secretsmanager.py @@ -378,11 +378,11 @@ def test_describe_secret_with_arn(): conn = boto3.client("secretsmanager", region_name="us-west-2") results = conn.create_secret(Name="test-secret", SecretString="foosecret") - secret_description = conn.describe_secret(SecretId=results['ARN']) + secret_description = conn.describe_secret(SecretId=results["ARN"]) assert secret_description # Returned dict is not empty assert secret_description["Name"] == ("test-secret") - assert secret_description["ARN"] != results['ARN'] + assert secret_description["ARN"] != results["ARN"] @mock_secretsmanager