diff --git a/moto/iot/models.py b/moto/iot/models.py index 1b10c09f..ce7a4cf5 100644 --- a/moto/iot/models.py +++ b/moto/iot/models.py @@ -32,6 +32,7 @@ class FakeThing(BaseModel): def to_dict(self, include_default_client_id=False): obj = { 'thingName': self.thing_name, + 'thingArn': self.arn, 'attributes': self.attributes, 'version': self.version } diff --git a/tests/test_iot/test_iot.py b/tests/test_iot/test_iot.py index 19e11476..21361579 100644 --- a/tests/test_iot/test_iot.py +++ b/tests/test_iot/test_iot.py @@ -35,12 +35,14 @@ def test_things(): res.should.have.key('things').which.should.have.length_of(1) for thing in res['things']: thing.should.have.key('thingName').which.should_not.be.none + thing.should.have.key('thingArn').which.should_not.be.none thing = client.update_thing(thingName=name, attributePayload={'attributes': {'k1': 'v1'}}) res = client.list_things() res.should.have.key('things').which.should.have.length_of(1) for thing in res['things']: thing.should.have.key('thingName').which.should_not.be.none + thing.should.have.key('thingArn').which.should_not.be.none res['things'][0]['attributes'].should.have.key('k1').which.should.equal('v1') thing = client.describe_thing(thingName=name)