Fix suggestion test to be order agnostic (#3822)

This commit is contained in:
Mike Degatano 2022-08-25 16:06:47 -04:00 committed by GitHub
parent 7b63544474
commit 2c5bb3f714
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -153,7 +153,14 @@ async def test_api_resolution_suggestions_for_issue(coresys: CoreSys, api_client
resp = await api_client.get(f"/resolution/issue/{corrupt_repo.uuid}/suggestions") resp = await api_client.get(f"/resolution/issue/{corrupt_repo.uuid}/suggestions")
result = await resp.json() result = await resp.json()
assert result["data"]["suggestions"][0]["uuid"] == execute_reset.uuid suggestion = [
assert result["data"]["suggestions"][0]["auto"] is True su for su in result["data"]["suggestions"] if su["uuid"] == execute_reset.uuid
assert result["data"]["suggestions"][1]["uuid"] == execute_remove.uuid ]
assert result["data"]["suggestions"][1]["auto"] is False assert bool(suggestion)
assert suggestion[0]["auto"] is True
suggestion = [
su for su in result["data"]["suggestions"] if su["uuid"] == execute_remove.uuid
]
assert bool(suggestion)
assert suggestion[0]["auto"] is False