Commit c05d082
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 c206c0c commit c05d082
2 files changed
Lines changed: 29 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1165 | 1165 | | |
1166 | 1166 | | |
1167 | 1167 | | |
1168 | | - | |
1169 | | - | |
1170 | | - | |
1171 | | - | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
1172 | 1172 | | |
1173 | 1173 | | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
1174 | 1179 | | |
1175 | 1180 | | |
1176 | 1181 | | |
| |||
1199 | 1204 | | |
1200 | 1205 | | |
1201 | 1206 | | |
1202 | | - | |
1203 | | - | |
| 1207 | + | |
| 1208 | + | |
1204 | 1209 | | |
1205 | 1210 | | |
1206 | 1211 | | |
1207 | 1212 | | |
1208 | 1213 | | |
| 1214 | + | |
1209 | 1215 | | |
1210 | 1216 | | |
1211 | 1217 | | |
| |||
1237 | 1243 | | |
1238 | 1244 | | |
1239 | 1245 | | |
1240 | | - | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
1241 | 1255 | | |
1242 | 1256 | | |
1243 | 1257 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
407 | 408 | | |
408 | 409 | | |
409 | 410 | | |
410 | | - | |
411 | | - | |
| 411 | + | |
| 412 | + | |
412 | 413 | | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
413 | 417 | | |
414 | 418 | | |
415 | 419 | | |
| |||
541 | 545 | | |
542 | 546 | | |
543 | 547 | | |
544 | | - | |
545 | | - | |
546 | | - | |
547 | | - | |
| 548 | + | |
| 549 | + | |
548 | 550 | | |
549 | 551 | | |
550 | 552 | | |
| |||
0 commit comments