Skip to content

Commit 5ee4cfb

Browse files
LTKortclaude
andcommitted
fix: resolve tech debt items from v1.0 audit
- Add missing test for GTMETRIX_DEFAULT_LOCATION config field - Update README test count from 74 to 78 - 78 tests pass, ruff clean Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 466a7e1 commit 5ee4cfb

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ client/
110110
tools/
111111
account.py # gtmetrix_check_status tool
112112
analyze.py # gtmetrix_analyze and gtmetrix_list_locations tools
113-
tests/ # pytest suite (74 tests)
113+
tests/ # pytest suite (78 tests)
114114
```
115115

116116
## Reference

tests/test_config.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,25 @@ def test_settings_default_adblock_from_env(monkeypatch):
6767
assert s.gtmetrix_default_adblock == "1"
6868

6969

70+
def test_settings_default_location_from_env(monkeypatch):
71+
"""Settings with GTMETRIX_DEFAULT_LOCATION env var returns that value."""
72+
monkeypatch.setenv("GTMETRIX_API_KEY", "key")
73+
monkeypatch.setenv("GTMETRIX_DEFAULT_LOCATION", "2")
74+
from config import Settings
75+
s = Settings()
76+
assert s.gtmetrix_default_location == "2"
77+
78+
7079
def test_settings_defaults_none_when_unset(monkeypatch):
71-
"""All three default fields are None when env vars not set."""
80+
"""All four default fields are None when env vars not set."""
7281
monkeypatch.setenv("GTMETRIX_API_KEY", "key")
7382
monkeypatch.delenv("GTMETRIX_DEFAULT_BROWSER", raising=False)
7483
monkeypatch.delenv("GTMETRIX_DEFAULT_DEVICE", raising=False)
7584
monkeypatch.delenv("GTMETRIX_DEFAULT_ADBLOCK", raising=False)
85+
monkeypatch.delenv("GTMETRIX_DEFAULT_LOCATION", raising=False)
7686
from config import Settings
7787
s = Settings()
7888
assert s.gtmetrix_default_browser is None
7989
assert s.gtmetrix_default_device is None
8090
assert s.gtmetrix_default_adblock is None
91+
assert s.gtmetrix_default_location is None

0 commit comments

Comments
 (0)