Skip to content

Commit

Permalink
fix: Updated the test case for ImagePredictionCollection
Browse files Browse the repository at this point in the history
  • Loading branch information
Jagrutiti committed Sep 16, 2022
1 parent 3a32fec commit 9d869c1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/integration/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,8 +741,8 @@ def test_image_prediction_collection(client):
assert result.status_code == 200
data = result.json
assert data["count"] == 1
assert data["images"][0]["id"] == prediction_category_123.id
assert data["images"][0]["image"]["barcode"] == "123"
assert data["image_predictions"][0]["id"] == prediction_category_123.id
assert data["image_predictions"][0]["image"]["barcode"] == "123"

# test with "type=label" and "with_logo=True"
result = client.simulate_get(
Expand All @@ -755,10 +755,10 @@ def test_image_prediction_collection(client):

assert result.status_code == 200
data = result.json
data["images"].sort(key=lambda d: d["id"])
data["image_predictions"].sort(key=lambda d: d["id"])
assert data["count"] == 2
assert data["images"][0]["id"] == prediction_label_789.id
assert data["images"][1]["id"] == prediction_label_789_no_logo.id
assert data["image_predictions"][0]["id"] == prediction_label_789.id
assert data["image_predictions"][1]["id"] == prediction_label_789_no_logo.id

# test with "barcode=456" and "with_logo=True"
result = client.simulate_get(
Expand All @@ -785,7 +785,7 @@ def test_image_prediction_collection(client):
assert result.status_code == 200
data = result.json
assert data["count"] == 1
assert data["images"][0]["id"] == prediction_label_789_no_logo.id
assert data["image_predictions"][0]["id"] == prediction_label_789_no_logo.id


def test_logo_annotation_collection_empty(client):
Expand Down

0 comments on commit 9d869c1

Please sign in to comment.