Place the Mogollon Rim Trail in the White Mountains of Arizona, and refuse a place that lies in none of a trail's states or provinces
A new registry range, white-mountains-arizona, shown as White Mountains, in Arizona. The validator now fails a record whose place's where shares no state or province with the record's regions, and place_trails.py no longer places a trail in a place outside its regions. The rule also caught the Hot Springs Trail (Nevada missing from its regions) and the North Boundary Trail (British Columbia missing), which now list those regions, and the Sentier international des Appalaches, whose track carries the Maine IAT into Katahdin Woods and Waters: that placement is removed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7e4d1de494
commit
3b745f706c
12 files changed
+111
-26
No files matched your search
@@ -183,3 +183,19 @@ class WholeRepoTest(unittest.TestCase):
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
|
||||
class PlaceLiesInTheTrailsRegionsTest(unittest.TestCase):
|
||||
def stated(self, **kw):
|
||||
return record(regions=kw.pop("regions"), places_checked="2026-11-20",
|
||||
place=[{"kind": "range", "slug": "wind-river-range", "basis": "stated",
|
||||
"source": "https://example.org/x"}])
|
||||
|
||||
def test_a_place_in_one_of_the_trails_states_passes(self):
|
||||
errs = record_errors(self.stated(regions=["ID", "WY"]))
|
||||
self.assertEqual([e for e in errs if "lies in" in e], [])
|
||||
|
||||
def test_a_place_in_none_of_the_trails_states_fails(self):
|
||||
errs = record_errors(self.stated(regions=["AZ", "NM"]))
|
||||
self.assertTrue(any("range/wind-river-range lies in WY, none of the record's regions (AZ, NM)" in e
|
||||
for e in errs), errs)
|
||||
Reference in new issue
Block a user