Skip to content

Commit 0234f4f

Browse files
committed
💚 Address coverage
1 parent dd1491f commit 0234f4f

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

‎tests/web/test_fields.py‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,38 @@ def station_model():
1111
"""Return a basemodel for testing."""
1212

1313
class Model(BaseModel):
14+
wfo: fields.WFO3_FIELD = "DMX"
1415
station: fields.STATION_LIST_FIELD
1516
tz: fields.TZ_FIELD = "UTC"
1617

1718
return Model
1819

1920

21+
@pytest.mark.parametrize(
22+
"wfo_input,wfo_expected",
23+
[
24+
("DMX", "DMX"),
25+
("KDMX", "DMX"),
26+
("PGUM", "GUM"),
27+
("PHFO", "HFO"),
28+
("PAFG", "AFG"),
29+
("PAJK", "AJK"),
30+
("PAFC", "AFC"),
31+
("TJSJ", "JSJ"),
32+
("TSJU", "JSJ"),
33+
],
34+
)
35+
def test_unrectify_wfo(station_model, wfo_input, wfo_expected):
36+
"""Test how WFO3_FIELD unrectifies four character WFOs."""
37+
assert station_model(wfo=wfo_input, station="A").wfo == wfo_expected
38+
39+
40+
def test_valid_tz(station_model):
41+
"""Test that a valid timezone works."""
42+
ans = "America/New_York"
43+
assert station_model(station="A", tz=ans).tz == ans
44+
45+
2046
def test_tz_aliases(station_model):
2147
"""Test that these are handled."""
2248
assert station_model(station="A", tz="").tz == "UTC"

0 commit comments

Comments
 (0)