From 0625bbfa11cb6e2440901da1c513bb4e522dd8ef Mon Sep 17 00:00:00 2001 From: Jon Michaelchuck <5964742+jbmchuck@users.noreply.github.com> Date: Wed, 24 Feb 2021 11:14:11 -0800 Subject: [PATCH] Fixes for IAM Role Description field in responses from list_roles and create_roles (#3724) * Add IAM Role Description field to list_roles responses The IAM ListRoles IAM API call will return the Description key/value for each role if it exists. If it does not exist the Description key is not included. * fix handling in create_role resp * blackg * Combine two tests using pytest.mark.parametrize * consistency --- moto/iam/responses.py | 5 ++++- tests/test_iam/test_iam.py | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/moto/iam/responses.py b/moto/iam/responses.py index 03ce13d23..7c46c23f6 100644 --- a/moto/iam/responses.py +++ b/moto/iam/responses.py @@ -1275,7 +1275,7 @@ CREATE_ROLE_TEMPLATE = """