Fix list_job_excecutions_for_thing with status parameter (#4334)
This commit is contained in:
parent
579b6e264f
commit
a02bf0022d
@ -1306,7 +1306,7 @@ class IoTBackend(BaseBackend):
|
||||
if status is not None:
|
||||
job_executions = list(
|
||||
filter(
|
||||
lambda elem: status in elem["status"] and elem["status"] == status,
|
||||
lambda elem: elem["jobExecutionSummary"].get("status") == status,
|
||||
job_executions,
|
||||
)
|
||||
)
|
||||
@ -1338,7 +1338,7 @@ class IoTBackend(BaseBackend):
|
||||
if status is not None:
|
||||
job_executions = list(
|
||||
filter(
|
||||
lambda elem: status in elem["status"] and elem["status"] == status,
|
||||
lambda elem: elem["jobExecutionSummary"].get("status") == status,
|
||||
job_executions,
|
||||
)
|
||||
)
|
||||
|
@ -2011,6 +2011,12 @@ def test_list_job_executions_for_job():
|
||||
"thingArn"
|
||||
).which.should.equal(thing["thingArn"])
|
||||
|
||||
job_execution = client.list_job_executions_for_job(jobId=job_id, status="QUEUED")
|
||||
job_execution.should.have.key("executionSummaries")
|
||||
job_execution["executionSummaries"][0].should.have.key(
|
||||
"thingArn"
|
||||
).which.should.equal(thing["thingArn"])
|
||||
|
||||
|
||||
@mock_iot
|
||||
def test_list_job_executions_for_thing():
|
||||
@ -2048,6 +2054,14 @@ def test_list_job_executions_for_thing():
|
||||
job_id
|
||||
)
|
||||
|
||||
job_execution = client.list_job_executions_for_thing(
|
||||
thingName=name, status="QUEUED"
|
||||
)
|
||||
job_execution.should.have.key("executionSummaries")
|
||||
job_execution["executionSummaries"][0].should.have.key("jobId").which.should.equal(
|
||||
job_id
|
||||
)
|
||||
|
||||
|
||||
class TestTopicRules:
|
||||
name = "my-rule"
|
||||
|
Loading…
Reference in New Issue
Block a user