internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: getmoto/moto

Issue:
eventName for a deleted record should be REMOVE instead of DELETE
When using Moto to mock DynamoDB streams, a deleted record has the eventName = "DELETE" right now:
https://github.com/spulec/moto/blob/9eb58eea411214ded617ea45ce9a4407a8f95194/moto/dynamodb2/models/__init__.py#L243-L250

AWS's DynanoDB Stream specification states that this should actually be `"REMOVE"`:
https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_Record.html#DDB-Type-streams_Record-eventName

I am on Moto version 1.3.16 and using the dynamodb2.start() and stop() methods




Discussion:
Thanks for raising this @wenjiezhou-rl - marking this as a bug!

Resolving patch:
diff --git a/moto/dynamodb2/models/__init__.py b/moto/dynamodb2/models/__init__.py
--- a/moto/dynamodb2/models/__init__.py
+++ b/moto/dynamodb2/models/__init__.py
@@ -245,7 +245,7 @@ def add(self, old, new):
         if old is None:
             event_name = "INSERT"
         elif new is None:
-            event_name = "DELETE"
+            event_name = "REMOVE"
         else:
             event_name = "MODIFY"
         seq = len(self.items) + self.starting_sequence_number


Test patch:
diff --git a/tests/test_dynamodbstreams/test_dynamodbstreams.py b/tests/test_dynamodbstreams/test_dynamodbstreams.py
--- a/tests/test_dynamodbstreams/test_dynamodbstreams.py
+++ b/tests/test_dynamodbstreams/test_dynamodbstreams.py
@@ -155,7 +155,7 @@ def test_get_records_seq(self):
         assert len(resp["Records"]) == 3
         assert resp["Records"][0]["eventName"] == "INSERT"
         assert resp["Records"][1]["eventName"] == "MODIFY"
-        assert resp["Records"][2]["eventName"] == "DELETE"
+        assert resp["Records"][2]["eventName"] == "REMOVE"
 
         sequence_number_modify = resp["Records"][1]["dynamodb"]["SequenceNumber"]
 
@@ -175,7 +175,7 @@ def test_get_records_seq(self):
         resp = conn.get_records(ShardIterator=iterator_id)
         assert len(resp["Records"]) == 2
         assert resp["Records"][0]["eventName"] == "MODIFY"
-        assert resp["Records"][1]["eventName"] == "DELETE"
+        assert resp["Records"][1]["eventName"] == "REMOVE"
 
         # check that if we get the shard iterator AFTER_SEQUENCE_NUMBER will get the DELETE event
         resp = conn.get_shard_iterator(
@@ -187,7 +187,7 @@ def test_get_records_seq(self):
         iterator_id = resp["ShardIterator"]
         resp = conn.get_records(ShardIterator=iterator_id)
         assert len(resp["Records"]) == 1
-        assert resp["Records"][0]["eventName"] == "DELETE"
+        assert resp["Records"][0]["eventName"] == "REMOVE"
 
 
 class TestEdges:
Repository: getmoto/moto

Issue:
RDS: TagList missing in describe_db_instance
There doesn't seem to be any support for tags in describe_db_instance. It seems to be on purpose, I couldn't find any test dealing with tags in this api call

The AWS API returns a TagList property when the instance is tagged.

(Edit: remove references to create_db_instance, which does in fact support the Tags property)


Discussion:

Resolving patch:
diff --git a/moto/rds2/models.py b/moto/rds2/models.py
--- a/moto/rds2/models.py
+++ b/moto/rds2/models.py
@@ -280,6 +280,14 @@ def to_xml(self):
                 <Port>{{ database.port }}</Port>
               </Endpoint>
               <DBInstanceArn>{{ database.db_instance_arn }}</DBInstanceArn>
+              <TagList>
+              {%- for tag in database.tags -%}
+                <Tag>
+                  <Key>{{ tag['Key'] }}</Key>
+                  <Value>{{ tag['Value'] }}</Value>
+                </Tag>
+              {%- endfor -%}
+              </TagList>
             </DBInstance>"""
         )
         return template.render(database=self)


Test patch:
diff --git a/tests/test_rds2/test_rds2.py b/tests/test_rds2/test_rds2.py
--- a/tests/test_rds2/test_rds2.py
+++ b/tests/test_rds2/test_rds2.py
@@ -1749,3 +1749,21 @@ def test_create_db_snapshot_with_iam_authentication():
     ).get("DBSnapshot")
 
     snapshot.get("IAMDatabaseAuthenticationEnabled").should.equal(True)
+
+
+@mock_rds2
+def test_create_db_instance_with_tags():
+    client = boto3.client("rds", region_name="us-west-2")
+    tags = [{"Key": "foo", "Value": "bar"}, {"Key": "foo1", "Value": "bar1"}]
+    db_instance_identifier = "test-db-instance"
+    resp = client.create_db_instance(
+        DBInstanceIdentifier=db_instance_identifier,
+        Engine="postgres",
+        DBName="staging-postgres",
+        DBInstanceClass="db.m1.small",
+        Tags=tags,
+    )
+    resp["DBInstance"]["TagList"].should.equal(tags)
+
+    resp = client.describe_db_instances(DBInstanceIdentifier=db_instance_identifier)
+    resp["DBInstances"][0]["TagList"].should.equal(tags)
Repository: getmoto/moto

Issue:
Does not work with latest `responses`
Moto has a hack where it sets the default responses mock's `_find_match` method to a custom one. The latest changes in `responses` have changed the return type of this method.

https://github.com/spulec/moto/blob/47dbad291e717059a93f5cf795a9be08cfc872cc/moto/core/models.py#L248-L267

See the [`responses`](https://github.com/getsentry/responses) change here https://github.com/getsentry/responses/commit/cf3c5a685ae95bee1a714fd36cfb77d448a4b5ec



Discussion:
We are also affected by this bug and had to force installation of previous version of `responses` (0.12.0), with 0.12.1 it fails as described in the bug report:
https://github.com/spulec/moto/blob/master/setup.py#L43

Resolving patch:
diff --git a/moto/core/models.py b/moto/core/models.py
--- a/moto/core/models.py
+++ b/moto/core/models.py
@@ -5,6 +5,7 @@
 import functools
 import inspect
 import os
+import pkg_resources
 import re
 import six
 import types
@@ -14,6 +15,7 @@
 from botocore.config import Config
 from botocore.handlers import BUILTIN_HANDLERS
 from botocore.awsrequest import AWSResponse
+from distutils.version import LooseVersion
 from six.moves.urllib.parse import urlparse
 from werkzeug.wrappers import Request
 
@@ -28,6 +30,7 @@
 )
 
 ACCOUNT_ID = os.environ.get("MOTO_ACCOUNT_ID", "123456789012")
+RESPONSES_VERSION = pkg_resources.get_distribution("responses").version
 
 
 class BaseMockAWS(object):
@@ -251,7 +254,7 @@ def _url_matches(self, url, other, match_querystring=False):
 responses_mock.add_passthru("http")
 
 
-def _find_first_match(self, request):
+def _find_first_match_legacy(self, request):
     for i, match in enumerate(self._matches):
         if match.matches(request):
             return match
@@ -259,12 +262,29 @@ def _find_first_match(self, request):
     return None
 
 
+def _find_first_match(self, request):
+    match_failed_reasons = []
+    for i, match in enumerate(self._matches):
+        match_result, reason = match.matches(request)
+        if match_result:
+            return match, match_failed_reasons
+        else:
+            match_failed_reasons.append(reason)
+
+    return None, match_failed_reasons
+
+
 # Modify behaviour of the matcher to only/always return the first match
 # Default behaviour is to return subsequent matches for subsequent requests, which leads to https://github.com/spulec/moto/issues/2567
 #  - First request matches on the appropriate S3 URL
 #  - Same request, executed again, will be matched on the subsequent match, which happens to be the catch-all, not-yet-implemented, callback
 # Fix: Always return the first match
-responses_mock._find_match = types.MethodType(_find_first_match, responses_mock)
+if LooseVersion(RESPONSES_VERSION) < LooseVersion("0.12.1"):
+    responses_mock._find_match = types.MethodType(
+        _find_first_match_legacy, responses_mock
+    )
+else:
+    responses_mock._find_match = types.MethodType(_find_first_match, responses_mock)
 
 
 BOTOCORE_HTTP_METHODS = ["GET", "DELETE", "HEAD", "OPTIONS", "PATCH", "POST", "PUT"]


Test patch:
Repository: getmoto/moto

Issue:
elasticbeanstalk ApplicationArn does not contain ApplicationName

```    
@mock_elasticbeanstalk
    def test_application_arn():
        client = boto3.client("elasticbeanstalk", region_name="us-east-1")
        app = client.create_application(ApplicationName="My App",)
>       assert "My App" in app["Application"]["ApplicationArn"]
E       AssertionError: assert 'My App' in 'arn:aws:elasticbeanstalk:us-east-1:111122223333:application/'
```


Discussion:

Resolving patch:
diff --git a/moto/elasticbeanstalk/responses.py b/moto/elasticbeanstalk/responses.py
--- a/moto/elasticbeanstalk/responses.py
+++ b/moto/elasticbeanstalk/responses.py
@@ -91,7 +91,7 @@ def list_tags_for_resource(self):
           </MaxCountRule>
         </VersionLifecycleConfig>
       </ResourceLifecycleConfig>
-      <ApplicationArn>arn:aws:elasticbeanstalk:{{ region_name }}:111122223333:application/{{ application_name }}</ApplicationArn>
+      <ApplicationArn>arn:aws:elasticbeanstalk:{{ region_name }}:111122223333:application/{{ application.application_name }}</ApplicationArn>
       <ApplicationName>{{ application.application_name }}</ApplicationName>
       <DateUpdated>2019-09-03T13:08:29.049Z</DateUpdated>
     </Application>
@@ -125,7 +125,7 @@ def list_tags_for_resource(self):
             </MaxCountRule>
           </VersionLifecycleConfig>
         </ResourceLifecycleConfig>
-        <ApplicationArn>arn:aws:elasticbeanstalk:{{ region_name }}:111122223333:application/{{ application.name }}</ApplicationArn>
+        <ApplicationArn>arn:aws:elasticbeanstalk:{{ region_name }}:111122223333:application/{{ application.application_name }}</ApplicationArn>
         <ApplicationName>{{ application.application_name }}</ApplicationName>
         <DateUpdated>2019-09-03T13:08:29.049Z</DateUpdated>
       </member>


Test patch:
diff --git a/tests/test_elasticbeanstalk/test_eb.py b/tests/test_elasticbeanstalk/test_eb.py
--- a/tests/test_elasticbeanstalk/test_eb.py
+++ b/tests/test_elasticbeanstalk/test_eb.py
@@ -11,6 +11,7 @@ def test_create_application():
     conn = boto3.client("elasticbeanstalk", region_name="us-east-1")
     app = conn.create_application(ApplicationName="myapp",)
     app["Application"]["ApplicationName"].should.equal("myapp")
+    app["Application"]["ApplicationArn"].should.contain("myapp")
 
 
 @mock_elasticbeanstalk
@@ -31,6 +32,7 @@ def test_describe_applications():
     apps = conn.describe_applications()
     len(apps["Applications"]).should.equal(1)
     apps["Applications"][0]["ApplicationName"].should.equal("myapp")
+    apps["Applications"][0]["ApplicationArn"].should.contain("myapp")
 
 
 @mock_elasticbeanstalk
Repository: getmoto/moto

Issue:
Dependency sshpubkeys dropped support for Py2.7
sshpubkeys==3.1.0 supports Py2.7, but sshpubkeys==3.2.0 only supports Python >= 3.6


PR with a fix incoming.


Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -86,7 +86,7 @@ def get_version():
 _dep_aws_xray_sdk = "aws-xray-sdk!=0.96,>=0.93"
 _dep_idna = "idna<3,>=2.5"
 _dep_cfn_lint = "cfn-lint>=0.4.0"
-_dep_sshpubkeys_py2 = "sshpubkeys>=3.1.0,<4.0; python_version<'3'"
+_dep_sshpubkeys_py2 = "sshpubkeys==3.1.0; python_version<'3'"
 _dep_sshpubkeys_py3 = "sshpubkeys>=3.1.0; python_version>'3'"
 
 all_extra_deps = [


Test patch:
Repository: getmoto/moto

Issue:
Implementation Coverage is wrong?
Hi,

I'm new to this great library so please if my understanding about it is wrong just let me know.

I would like to point that I've found discordance between the examples on the README.md and the IMPLEMENTATION_COVERAGE.md.  

In the README.md there is an example that uses **describe_instances**

```
from . import add_servers
from moto import mock_ec2

@mock_ec2
def test_add_servers():
    add_servers('ami-1234abcd', 2)

    client = boto3.client('ec2', region_name='us-west-1')
    instances = client.describe_instances()['Reservations'][0]['Instances']
    assert len(instances) == 2
    instance1 = instances[0]
    assert instance1['ImageId'] == 'ami-1234abcd'

```

And then on the IMPLEMENTATION_COVERAGE.md the **describe_instances** is not marked as implemented.
Is the IMPLEMENTATION_COVERAGE not up to date or is this an error?

Thanks.


Discussion:
Hi @omar-ogm, thanks for raising this!
`describe_instances()` is definitely supported. The IMPLEMENTATION_COVERAGE doc is generated automatically, so it's either out of date or there's a bug that causes it not to pick up that specific method. Will look into it.

Resolving patch:
diff --git a/moto/ec2/models.py b/moto/ec2/models.py
--- a/moto/ec2/models.py
+++ b/moto/ec2/models.py
@@ -1000,6 +1000,11 @@ def add_instances(self, image_id, count, user_data, security_group_names, **kwar
 
         return new_reservation
 
+    def run_instances(self):
+        # Logic resides in add_instances
+        # Fake method here to make implementation coverage script aware that this method is implemented
+        pass
+
     def start_instances(self, instance_ids):
         started_instances = []
         for instance in self.get_multi_instances_by_id(instance_ids):
diff --git a/moto/sts/models.py b/moto/sts/models.py
--- a/moto/sts/models.py
+++ b/moto/sts/models.py
@@ -122,5 +122,10 @@ def assume_role_with_saml(self, **kwargs):
         self.assumed_roles.append(role)
         return role
 
+    def get_caller_identity(self):
+        # Logic resides in responses.py
+        # Fake method here to make implementation coverage script aware that this method is implemented
+        pass
+
 
 sts_backend = STSBackend()


Test patch:
Repository: getmoto/moto

Issue:
[SES] `send_templated_email` does not raise `TemplateDoesNotExist` with invalid template
How to reproduce:

```python
import boto3
from moto import mock_ses


@mock_ses
def test_ses():
    ses = boto3.client("ses", region_name="us-east-1")
    res = ses.send_templated_email(
        Source="hello@example.com", 
        Destination={"BccAddresses": ["jdoe@example.com"]}, 
        Template="foobar", 
        TemplateData='{}', 
        ConfigurationSetName="blah"
    )
```

Expected:

Template "foobar" does not exist, so the call should raise:

```
botocore.errorfactory.TemplateDoesNotExistException: An error occurred (TemplateDoesNotExist) when calling the SendTemplatedEmail operation: Template foobar does not exist.
```

AWS Docs: https://docs.aws.amazon.com/ses/latest/APIReference/API_SendTemplatedEmail.html


Discussion:

Resolving patch:
diff --git a/moto/ses/models.py b/moto/ses/models.py
--- a/moto/ses/models.py
+++ b/moto/ses/models.py
@@ -164,6 +164,9 @@ def send_templated_email(
             self.rejected_messages_count += 1
             raise MessageRejectedError("Email address not verified %s" % source)
 
+        if not self.templates.get(template[0]):
+            raise TemplateDoesNotExist("Template (%s) does not exist" % template[0])
+
         self.__process_sns_feedback__(source, destinations, region)
 
         message_id = get_random_message_id()


Test patch:
diff --git a/tests/test_ses/test_ses_boto3.py b/tests/test_ses/test_ses_boto3.py
--- a/tests/test_ses/test_ses_boto3.py
+++ b/tests/test_ses/test_ses_boto3.py
@@ -132,6 +132,21 @@ def test_send_templated_email():
     conn.send_templated_email.when.called_with(**kwargs).should.throw(ClientError)
 
     conn.verify_domain_identity(Domain="example.com")
+
+    with pytest.raises(ClientError) as ex:
+        conn.send_templated_email(**kwargs)
+
+    ex.value.response["Error"]["Code"].should.equal("TemplateDoesNotExist")
+
+    conn.create_template(
+        Template={
+            "TemplateName": "test_template",
+            "SubjectPart": "lalala",
+            "HtmlPart": "",
+            "TextPart": "",
+        }
+    )
+
     conn.send_templated_email(**kwargs)
 
     too_many_addresses = list("to%s@example.com" % i for i in range(51))
Repository: getmoto/moto

Issue:
Moto SSM put parameter allows empty string as a value, real service does not
Hello,

I noticed that moto SSM service allows putting parameter with empty string. This is not available in boto or via AWS web UI.
Moto is running in server mode. 

1. boto3==1.17.35
2. botocore==1.20.35
3. moto==2.0.2

Code example that is invoking parameter creation using moto:
`client.ssm.put_parameter(
            Name='test',
            Description='string',
            Value='',
            Type='String',
            Overwrite=True
        )`

It creates the parameter and returns empty string when fetched.

This is, on the other hand, output from boto parameter creation:
`$ aws ssm put-parameter --name "/test" --value "" --profile saml
An error occurred (ValidationException) when calling the PutParameter operation: 1 validation error detected: Value '' at 'value' failed to satisfy constraint: Member must have length greater than or equal to 1.`

That makes inconsistency. Is this a feature somehow or should be fixed?

Regards


Discussion:
Hi @tokwiat, thanks for raising this!
Will mark it as an enhancement to implement value-validation, as we don't have anything at the moment.
Ok, cool, thanks for answer. 

Resolving patch:
diff --git a/moto/ssm/models.py b/moto/ssm/models.py
--- a/moto/ssm/models.py
+++ b/moto/ssm/models.py
@@ -1284,6 +1284,11 @@ def label_parameter_version(self, name, version, labels):
     def put_parameter(
         self, name, description, value, type, allowed_pattern, keyid, overwrite, tags,
     ):
+        if not value:
+            raise ValidationException(
+                "1 validation error detected: Value '' at 'value' failed to satisfy"
+                " constraint: Member must have length greater than or equal to 1."
+            )
         if name.lower().lstrip("/").startswith("aws") or name.lower().lstrip(
             "/"
         ).startswith("ssm"):


Test patch:
diff --git a/tests/test_ssm/test_ssm_boto3.py b/tests/test_ssm/test_ssm_boto3.py
--- a/tests/test_ssm/test_ssm_boto3.py
+++ b/tests/test_ssm/test_ssm_boto3.py
@@ -299,6 +299,22 @@ def test_put_parameter():
     )
 
 
+@mock_ssm
+def test_put_parameter_empty_string_value():
+    client = boto3.client("ssm", region_name="us-east-1")
+    with pytest.raises(ClientError) as e:
+        client.put_parameter(Name="test_name", Value="", Type="String")
+    ex = e.value
+    ex.operation_name.should.equal("PutParameter")
+    ex.response["ResponseMetadata"]["HTTPStatusCode"].should.equal(400)
+    ex.response["Error"]["Code"].should.contain("ValidationException")
+    ex.response["Error"]["Message"].should.equal(
+        "1 validation error detected: "
+        "Value '' at 'value' failed to satisfy constraint: "
+        "Member must have length greater than or equal to 1."
+    )
+
+
 @mock_ssm
 def test_put_parameter_invalid_names():
     client = boto3.client("ssm", region_name="us-east-1")
Repository: getmoto/moto

Issue:
mock_events: `Rule` does not use `MOTO_ACCOUNT_ID`
I've noticed while taking a look through the events code that the `Rule` class does uses the account ID `111111111111` during construction when no ARN is specified:

```py
class Rule(CloudFormationModel):
    Arn = namedtuple("Arn", ["service", "resource_type", "resource_id"])

    def _generate_arn(self, name):
        return "arn:aws:events:{region_name}:111111111111:rule/{name}".format(
            region_name=self.region_name, name=name
        )

    def __init__(self, name, region_name, **kwargs):
        self.name = name
        self.region_name = region_name
        self.arn = kwargs.get("Arn") or self._generate_arn(name)
        self.event_pattern = kwargs.get("EventPattern")
        self.schedule_exp = kwargs.get("ScheduleExpression")
        self.state = kwargs.get("State") or "ENABLED"
        self.description = kwargs.get("Description")
        self.role_arn = kwargs.get("RoleArn")
        self.event_bus_name = kwargs.get("EventBusName") or "default"
        self.targets = []
```

I think it'd make sense to use the environment variable `MOCK_ACCOUNT_ID` as other classes in `moto/events/models.py` do. PR incoming!


Discussion:

Resolving patch:
diff --git a/moto/events/models.py b/moto/events/models.py
--- a/moto/events/models.py
+++ b/moto/events/models.py
@@ -28,8 +28,8 @@ class Rule(CloudFormationModel):
     Arn = namedtuple("Arn", ["service", "resource_type", "resource_id"])
 
     def _generate_arn(self, name):
-        return "arn:aws:events:{region_name}:111111111111:rule/{name}".format(
-            region_name=self.region_name, name=name
+        return "arn:aws:events:{region_name}:{account}:rule/{name}".format(
+            region_name=self.region_name, account=ACCOUNT_ID, name=name
         )
 
     def __init__(self, name, region_name, **kwargs):


Test patch:
diff --git a/tests/test_events/test_events.py b/tests/test_events/test_events.py
--- a/tests/test_events/test_events.py
+++ b/tests/test_events/test_events.py
@@ -120,9 +120,11 @@ def test_describe_rule():
 
     assert response is not None
     assert response.get("Name") == rule_name
-    assert response.get(
-        "Arn"
-    ) == "arn:aws:events:us-west-2:111111111111:rule/{0}".format(rule_name)
+
+    rule_arn = response.get("Arn")
+    assert rule_arn == "arn:aws:events:us-west-2:{account}:rule/{name}".format(
+        account=ACCOUNT_ID, name=rule_name
+    )
 
 
 @mock_events
Repository: getmoto/moto

Issue:
The iam.get_user method does not return any tags when mocked.
The `iam.get_user` method does not return any tags when mocked. But when tested against a live environment without moto it **does** return tags.

```python
#!/usr/bin/env python3
import json

import boto3
from moto import mock_iam

mock_iam = mock_iam()
mock_iam.start()
iam = boto3.client('iam')
iam.create_user(
    UserName='TestUser1',
    Tags=[
        {
            'Key': 'TestTag1',
            'Value': '90'
        },
        {
            'Key': 'TestTag2',
            'Value': 'abc'
        }
    ]
)
resp = iam.get_user(
        UserName='TestUser1'
)
print(json.dumps(resp['User'], indent=2, default=str))
```
Returns
```json
{
  "Path": "/",
  "UserName": "TestUser1",
  "UserId": "h3lhk2pzgb39o9zvtak2",
  "Arn": "arn:aws:iam::123456789012:user/TestUser1",
  "CreateDate": "2021-04-02 04:31:41.912000+00:00"
}
```
Expected
```json
{
  "Path": "/",
  "UserName": "TestUser1",
  "UserId": "h3lhk2pzgb39o9zvtak2",
  "Arn": "arn:aws:iam::123456789012:user/TestUser1",
  "CreateDate": "2021-04-02 04:31:41.912000+00:00",
  "Tags": [
    {
        "Key": "TestTag1",
        "Value": "90"
    },
    {
        "Key": "TestTag2",
        "Value": "abc"
    }
  ]
}
```


Discussion:

Resolving patch:
diff --git a/moto/iam/responses.py b/moto/iam/responses.py
--- a/moto/iam/responses.py
+++ b/moto/iam/responses.py
@@ -484,9 +484,9 @@ def get_user(self):
                 user = User("default_user")
         else:
             user = iam_backend.get_user(user_name)
-
+        tags = iam_backend.tagger.list_tags_for_resource(user.arn).get("Tags", [])
         template = self.response_template(USER_TEMPLATE)
-        return template.render(action="Get", user=user)
+        return template.render(action="Get", user=user, tags=tags)
 
     def list_users(self):
         path_prefix = self._get_param("PathPrefix")


Test patch:
diff --git a/tests/test_iam/test_iam.py b/tests/test_iam/test_iam.py
--- a/tests/test_iam/test_iam.py
+++ b/tests/test_iam/test_iam.py
@@ -4075,7 +4075,8 @@ def test_create_user_with_tags():
     assert resp["User"]["Tags"] == tags
     resp = conn.list_user_tags(UserName=user_name)
     assert resp["Tags"] == tags
-
+    resp = conn.get_user(UserName=user_name)
+    assert resp["User"]["Tags"] == tags
     resp = conn.create_user(UserName="test-create-user-no-tags")
     assert "Tags" not in resp["User"]