* fix #3867 iot list_principal_things should return list of thingnames. * lint
This commit is contained in:
parent
9b3e932822
commit
df34b7864b
@ -925,7 +925,7 @@ class IoTBackend(BaseBackend):
|
|||||||
|
|
||||||
def list_principal_things(self, principal_arn):
|
def list_principal_things(self, principal_arn):
|
||||||
thing_names = [
|
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
|
return thing_names
|
||||||
|
|
||||||
|
@ -847,8 +847,7 @@ def test_principal_thing():
|
|||||||
|
|
||||||
res = client.list_principal_things(principal=cert_arn)
|
res = client.list_principal_things(principal=cert_arn)
|
||||||
res.should.have.key("things").which.should.have.length_of(1)
|
res.should.have.key("things").which.should.have.length_of(1)
|
||||||
for thing in res["things"]:
|
res["things"][0].should.equal(thing_name)
|
||||||
thing.should_not.be.none
|
|
||||||
res = client.list_thing_principals(thingName=thing_name)
|
res = client.list_thing_principals(thingName=thing_name)
|
||||||
res.should.have.key("principals").which.should.have.length_of(1)
|
res.should.have.key("principals").which.should.have.length_of(1)
|
||||||
for principal in res["principals"]:
|
for principal in res["principals"]:
|
||||||
|
Loading…
Reference in New Issue
Block a user