fix #3867 IoT list_principal_things (#3868)

* fix #3867
iot list_principal_things should return list of thingnames.

* lint
This commit is contained in:
cm-iwata 2021-04-19 21:35:09 +09:00 committed by GitHub
parent 9b3e932822
commit df34b7864b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -925,7 +925,7 @@ class IoTBackend(BaseBackend):
def list_principal_things(self, principal_arn):
thing_names = [
k[0] for k, v in self.principal_things.items() if k[0] == principal_arn
k[1] for k, v in self.principal_things.items() if k[0] == principal_arn
]
return thing_names

View File

@ -847,8 +847,7 @@ def test_principal_thing():
res = client.list_principal_things(principal=cert_arn)
res.should.have.key("things").which.should.have.length_of(1)
for thing in res["things"]:
thing.should_not.be.none
res["things"][0].should.equal(thing_name)
res = client.list_thing_principals(thingName=thing_name)
res.should.have.key("principals").which.should.have.length_of(1)
for principal in res["principals"]: