Skip to content

Commit 81f8be2

Browse files
committed
test: allow mobile fixtures alongside bulk data
Refs GetTechAPI/TechAPI#1
1 parent 5203465 commit 81f8be2

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

tests/integration/test_mobile_devices.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ def test_list_mobile_device_categories(client: TestClient) -> None:
1616
]
1717

1818
for resource, slug in cases:
19-
body = client.get(f"/v1/{resource}").json()
20-
assert body["count"] >= 1
21-
assert any(item["slug"] == slug for item in body["results"])
19+
list_body = client.get(f"/v1/{resource}").json()
20+
detail_body = client.get(f"/v1/{resource}/{slug}").json()
21+
assert list_body["count"] >= 1
22+
assert detail_body["slug"] == slug
2223

2324

2425
def test_mobile_device_detail_includes_variant_fields(client: TestClient) -> None:
@@ -35,12 +36,14 @@ def test_mobile_device_detail_includes_variant_fields(client: TestClient) -> Non
3536
def test_mobile_device_filters(client: TestClient) -> None:
3637
ensure_mobile_device_fixtures()
3738
brand_body = client.get("/v1/watches?brand=samsung").json()
38-
assert {item["slug"] for item in brand_body["results"]} == {
39-
"galaxy-watch-global-bluetooth-42mm"
39+
assert "galaxy-watch-global-bluetooth-42mm" in {
40+
item["slug"] for item in brand_body["results"]
4041
}
4142

4243
base_body = client.get("/v1/tablets?base_model_slug=ipad-pro-11-m4").json()
43-
assert {item["slug"] for item in base_body["results"]} == {"ipad-pro-11-m4-wifi-8gb-256gb"}
44+
assert "ipad-pro-11-m4-wifi-8gb-256gb" in {
45+
item["slug"] for item in base_body["results"]
46+
}
4447

4548

4649
def test_mobile_device_unknown_slug_404(client: TestClient) -> None:

tests/integration/test_socs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ def test_unknown_soc_404(client: TestClient) -> None:
3131

3232

3333
def test_soc_smartphones_relation(client: TestClient) -> None:
34-
body = client.get("/v1/socs/snapdragon-8-elite/smartphones").json()
34+
body = client.get("/v1/socs/snapdragon-8-elite/smartphones?limit=100").json()
3535
slugs = {item["slug"] for item in body["results"]}
3636
assert {"galaxy-s25", "oneplus-13"} <= slugs

0 commit comments

Comments
 (0)