From 821cd5376d35619174a4b2cd5cd2f726ca0b2f22 Mon Sep 17 00:00:00 2001 From: Stephan Huber Date: Mon, 4 Jun 2018 15:58:08 +0200 Subject: [PATCH 1/2] return thingArn when using list_things --- tests/test_iot/test_iot.py | 2 ++ 1 file changed, 2 insertions(+) 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) From afa6ae288d7f0d8865c8050c436cc1e2f0c2da72 Mon Sep 17 00:00:00 2001 From: Stephan Huber Date: Mon, 4 Jun 2018 15:58:27 +0200 Subject: [PATCH 2/2] return thing_arn when calling list_things --- moto/iot/models.py | 1 + 1 file changed, 1 insertion(+) 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 }