Let a place carry its own label and preposition, keep the count in every place title, and test that slugs follow names
A registry entry may now set label and prep. A plateau reads "Plateau" and "on the Colorado Plateau", the Mogollon Rim "Escarpment" and "along the Mogollon Rim", a national monument or a parkway its own word; the default is still "Mountain range" and "in the". Every national park, provincial park, monument, recreation area and parkway in the registry is labelled. A place title no longer gives up its ": N Trails" ending when it is long: it drops the state first and then keeps the count over the cap, and the state is left out where the name already holds it (Oregon Cascades, California Coast Ranges). A test checks that every slug is the slug of its display name, with the Arizona White Mountains as the one stated exception. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a97ea85093
commit
30d03b8069
10 files changed
+307
-43
No files matched your search
@@ -605,6 +605,16 @@ class ApplyTest(unittest.TestCase):
|
||||
P.apply(self.pjson, self.root, "2026-12-01")
|
||||
self.assertEqual(read_toml(path)["place"][0]["where"], ["MT", "WY"])
|
||||
|
||||
def test_a_reviewed_label_and_preposition_survive_a_rerun(self):
|
||||
P.apply(self.pjson, self.root, "2026-11-20")
|
||||
path = os.path.join(self.root, "places.toml")
|
||||
text = open(path).read()
|
||||
open(path, "w").write(text.replace('name = "Alpha Park"',
|
||||
'name = "Alpha Park"\nlabel = "National park"\nprep = "along the"'))
|
||||
P.apply(self.pjson, self.root, "2026-12-01")
|
||||
entry = read_toml(path)["place"][0]
|
||||
self.assertEqual((entry["label"], entry["prep"]), ("National park", "along the"))
|
||||
|
||||
def test_stated_requires_an_http_source_a_quote_and_a_trackless_record(self):
|
||||
P.apply(self.pjson, self.root, "2026-11-20")
|
||||
with self.assertRaises(ValueError):
|
||||
|
||||
Reference in new issue
Block a user