Skip to content

Commit 751d3b3

Browse files
thodson-usgsclaude
andcommitted
test(nwis): parse with raw read_rdb in empty-peaks regression test
The empty-peaks test parsed with _read_rdb, which already runs format_response(service=None); the real get_discharge_peaks path uses the raw read_rdb parser followed by format_response(service="peaks"). Switch to read_rdb so the test exercises the actual call path without the redundant format pass. Signed-off-by: thodson-usgs <thodson@usgs.gov> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 1dd136f commit 751d3b3

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tests/nwis_test.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
get_record,
2121
get_water_use,
2222
preformat_peaks_response,
23+
read_rdb,
2324
)
2425

2526
START_DATE = "2018-01-24"
@@ -317,7 +318,9 @@ def test_no_peaks_flows_through_format_response(self):
317318
"# //Response-Status: OK\n"
318319
"# //Response-Message: No sites found matching all criteria\n"
319320
)
320-
df = _read_rdb(no_peaks_rdb)
321+
# Mirror get_discharge_peaks: raw read_rdb, then the peaks-specific
322+
# format_response (not _read_rdb, which formats with service=None).
323+
df = read_rdb(no_peaks_rdb)
321324
df = format_response(df, service="peaks")
322325
assert isinstance(df, pd.DataFrame)
323326
assert df.empty

0 commit comments

Comments
 (0)