diff --git a/app/models.py b/app/models.py index 5c6aa98..571c2d7 100644 --- a/app/models.py +++ b/app/models.py @@ -149,7 +149,7 @@ CW Curaçao CX Christmas Island CY Cyprus | Κύπρος | Kypros | Kibris CZ Czechia | Czech Republic | Česko | Česká republika -DE Germany | Deutschland +DE Germany | Deutschland | DEU | Deutschlandweit DJ Djibouti DK Denmark | Danmark DM Dominica @@ -325,7 +325,7 @@ TZ Tanzania UA Ukraine | Україна | Ukraina UG Uganda UM United States Minor Outlying Islands -US United States | United States of America | USA | U.S.A. | US | U.S. | Americas +US United States | United States of America | USA | U.S.A. | US | U.S. | Americas | AMER | North America UY Uruguay UZ Uzbekistan VA Vatican City | Holy See @@ -393,7 +393,8 @@ _CITIES: dict[str, str] = { "oldenburg", "emmendingen", "wuppertal", "wiesbaden", "tubingen", "mainz", "lubeck", "bayreuth", "bad homburg", "homburg", "ettlingen", "bremerhaven", "breidenbach", "bielefeld", "saarbrucken", "hildesheim", "moers", "kiel", - "ulm", "regensburg", "freiburg", "obersulm"), "DE"), + "ulm", "regensburg", "freiburg", "obersulm", "seevetal", + "neukirchen vluyn"), "DE"), **dict.fromkeys(("athens", "thessaloniki"), "GR"), **dict.fromkeys(("budapest",), "HU"), **dict.fromkeys(("dublin", "cork", "galway", "limerick"), "IE"), diff --git a/app/places.py b/app/places.py index f29e67e..f443a06 100644 --- a/app/places.py +++ b/app/places.py @@ -135,6 +135,7 @@ _ALIAS_GROUPS: tuple[tuple[str, ...], ...] = ( ("Lübeck", "Luebeck", "Lubeck"), ("Münster", "Muenster", "Munster"), ("Saarbrücken", "Saarbruecken", "Saarbrucken"), + ("Neukirchen-Vluyn",), # Austria ("Vienna", "Wien", "Vienne"), ("Salzburg",), @@ -304,8 +305,16 @@ _ORESUND = Region( _split("Øresund, Öresund, Oresund, Oresund Region, Øresundsregionen, Öresundsregionen"), (), includes=("hovedstaden", "skane")) +# Germany's by the names boards write for a remote role's area, towns not +# listed: a town in Germany is found through the country. +_GERMANY = tuple(Region(key, label, _split(names), (), "DE") for key, label, names in ( + ("niedersachsen", "Niedersachsen", "Niedersachsen, Lower Saxony"), + ("norddeutschland", "Norddeutschland", "Norddeutschland, Northern Germany"), + ("ostdeutschland", "Ostdeutschland", "Ostdeutschland, Eastern Germany"), + ("suddeutschland", "Süddeutschland", "Süddeutschland, Southern Germany"))) + REGIONS: dict[str, Region] = { - r.key: r for r in (_SKANE, _HOVEDSTADEN, _ZEALAND, _ORESUND, _JUTLAND, _FUNEN)} + r.key: r for r in (_SKANE, _HOVEDSTADEN, _ZEALAND, _ORESUND, _JUTLAND, _FUNEN, *_GERMANY)} def _phrases(region: Region) -> tuple[str, ...]: diff --git a/tests/test_places.py b/tests/test_places.py index 98e3395..f19dabd 100644 --- a/tests/test_places.py +++ b/tests/test_places.py @@ -351,10 +351,13 @@ def test_null_columns_match_nothing_and_do_not_raise() -> None: def test_every_region_has_names_and_towns() -> None: - assert set(REGIONS) == {"skane", "hovedstaden", "zealand", "oresund", "jutland", "funen"} + germany = {"niedersachsen", "norddeutschland", "ostdeutschland", "suddeutschland"} + assert set(REGIONS) == {"skane", "hovedstaden", "zealand", "oresund", "jutland", + "funen"} | germany for key, region in REGIONS.items(): assert region.key == key and region.label and region.names - assert region.towns or region.includes + # Germany's are named only; its towns are found through the country. + assert region.towns or region.includes or key in germany def test_the_bare_word_zealand_is_no_name_since_new_zealand_has_it() -> None: