feat(client): add STATION_CODE env var and config attribute
Reads STATION_CODE from the environment and exposes it as Config.STATION_CODE (None when unset or empty). Adds the variable to .env.example with a per-station deployment note, and covers both read and missing-key paths with new pytest tests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
"""Tests that STATION_CODE is loaded from env and exposed on the client Config class."""
|
||||
import importlib
|
||||
import os
|
||||
|
||||
|
||||
def test_station_code_read_from_env(monkeypatch):
|
||||
monkeypatch.setenv("STATION_CODE", "ST-TEST")
|
||||
import config
|
||||
importlib.reload(config)
|
||||
assert config.Config.STATION_CODE == "ST-TEST"
|
||||
|
||||
|
||||
def test_station_code_defaults_to_none_when_missing(monkeypatch):
|
||||
monkeypatch.delenv("STATION_CODE", raising=False)
|
||||
import config
|
||||
importlib.reload(config)
|
||||
assert config.Config.STATION_CODE is None
|
||||
Reference in New Issue
Block a user