Commit e8c8e88
Polish from /simplify review
Three small follow-ups to c206c0c addressing review findings:
1. Restore the AGENCY-ID hint in _check_monitoring_location_id's TypeError.
The refactor through _normalize_str_iterable accidentally dropped the
trailing "Expected 'AGENCY-ID' format, e.g., 'USGS-01646500'." that
the original wrapper carried. Catch+re-raise so monitoring_location_id
keeps its helpful error while the generic helper stays generic.
Pinned with a new assertion in test_integer_raises_type_error.
2. Document the date-range exclusion in _normalize_str_iterable's docstring.
`time`, `last_modified`, `begin`, `end`, `datetime` bypass this helper
because _format_api_dates handles their single-string-or-range semantics
inside _construct_api_requests; the exclusion lived only in the prior
commit message.
3. Single-pass validation. The helper previously did `values = list(value)`
followed by a separate `for v in values` isinstance loop. Folded into
one loop that builds the list while validating per-element.
Plus tests: hoist `from unittest import mock` to module level
(matches the rest of the repo's test files) instead of importing it
inside the test body.
No behavior change for valid inputs.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent df3c108 commit e8c8e88
2 files changed
Lines changed: 29 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1181 | 1181 | | |
1182 | 1182 | | |
1183 | 1183 | | |
1184 | | - | |
1185 | | - | |
1186 | | - | |
1187 | | - | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
1188 | 1188 | | |
1189 | 1189 | | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
1190 | 1195 | | |
1191 | 1196 | | |
1192 | 1197 | | |
| |||
1215 | 1220 | | |
1216 | 1221 | | |
1217 | 1222 | | |
1218 | | - | |
1219 | | - | |
| 1223 | + | |
| 1224 | + | |
1220 | 1225 | | |
1221 | 1226 | | |
1222 | 1227 | | |
1223 | 1228 | | |
1224 | 1229 | | |
| 1230 | + | |
1225 | 1231 | | |
1226 | 1232 | | |
1227 | 1233 | | |
| |||
1253 | 1259 | | |
1254 | 1260 | | |
1255 | 1261 | | |
1256 | | - | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
1257 | 1271 | | |
1258 | 1272 | | |
1259 | 1273 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
531 | 532 | | |
532 | 533 | | |
533 | 534 | | |
534 | | - | |
535 | | - | |
| 535 | + | |
| 536 | + | |
536 | 537 | | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
537 | 541 | | |
538 | 542 | | |
539 | 543 | | |
| |||
665 | 669 | | |
666 | 670 | | |
667 | 671 | | |
668 | | - | |
669 | | - | |
670 | | - | |
671 | | - | |
| 672 | + | |
| 673 | + | |
672 | 674 | | |
673 | 675 | | |
674 | 676 | | |
| |||
0 commit comments