/
/
/
1"""Tests for the provider icon size check."""
2
3from scripts.check_provider_icons import (
4 BASELINE_PATH,
5 MAX_SIZE_BY_SUFFIX,
6 find_oversized_icons,
7 main,
8)
9from scripts.lint_baseline import load_baseline
10
11
12def test_size_budgets() -> None:
13 """The icon budgets are 5 KB for svg and 20 KB for png."""
14 assert MAX_SIZE_BY_SUFFIX == {".svg": 5 * 1024, ".png": 20 * 1024}
15
16
17def test_oversized_icons_match_baseline() -> None:
18 """Every currently-oversized icon is grandfathered in the baseline (no new offenders)."""
19 assert set(find_oversized_icons()) == set(load_baseline(BASELINE_PATH))
20
21
22def test_check_passes_against_baseline() -> None:
23 """The check passes because the tree matches its baseline exactly."""
24 assert main([]) == 0
25