Skip to content

Commit 22d6c16

Browse files
committed
fix(api): satisfy mobile category lint
Refs #1
1 parent 7a42dc7 commit 22d6c16

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

app/validate.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,9 @@ def _check_variant_path(
175175
errors.append(f"{fname}: lives in brand '{brand}' but brand='{rec.get('brand')}'")
176176
release_year = str(rec.get("release_date", ""))[:4]
177177
if release_year and year != release_year:
178-
errors.append(f"{fname}: lives in year '{year}' but release_date starts with '{release_year}'")
178+
errors.append(
179+
f"{fname}: lives in year '{year}' but release_date starts with '{release_year}'"
180+
)
179181
if rec.get("base_model_slug") and rec.get("base_model_slug") != base_model_slug:
180182
errors.append(
181183
f"{fname}: lives under base '{base_model_slug}' but "

tests/integration/test_mobile_devices.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ def test_mobile_device_detail_includes_variant_fields(client: TestClient) -> Non
3030

3131
def test_mobile_device_filters(client: TestClient) -> None:
3232
brand_body = client.get("/v1/watches?brand=samsung").json()
33-
assert {item["slug"] for item in brand_body["results"]} == {"galaxy-watch-global-bluetooth-42mm"}
33+
assert {item["slug"] for item in brand_body["results"]} == {
34+
"galaxy-watch-global-bluetooth-42mm"
35+
}
3436

3537
base_body = client.get("/v1/tablets?base_model_slug=ipad-pro-11-m4").json()
3638
assert {item["slug"] for item in base_body["results"]} == {"ipad-pro-11-m4-wifi-8gb-256gb"}

0 commit comments

Comments
 (0)