Let a role that names no town join one group, never bridge two, and place dupes above places
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d060bee5b7
commit
1e22537ae5
3 files changed
+36
-8
No files matched your search
@@ -31,7 +31,7 @@ ROOT = Path(__file__).resolve().parents[1]
|
||||
#: no database, so storage may use them. `main` assembles the app from
|
||||
#: everything below it; `cli` and `__main__` are the entry points and may
|
||||
#: reach anything.
|
||||
LAYERS = ["models", "places", "seniority", "config", "storage", "jobs", "web", "main", "cli",
|
||||
LAYERS = ["models", "places", "dupes", "seniority", "config", "storage", "jobs", "web", "main", "cli",
|
||||
"__main__"]
|
||||
APP = "app"
|
||||
EXTERNAL = {"desk", "pipeline", "auth"}
|
||||
|
||||
@@ -156,3 +156,13 @@ def test_keep_order_ranks():
|
||||
assert sorted([undated, late, early], key=keep_order) == [early, late, undated]
|
||||
assert min([cp("b", posted="2026-01-01"), cp("a", posted="2026-01-01")],
|
||||
key=keep_order).uid == "a"
|
||||
|
||||
|
||||
def test_a_row_without_a_town_joins_only_one_group():
|
||||
# "Germany" matches Berlin and Munich; joining both would make them one role.
|
||||
rows = [cp("a", place="Berlin"), cp("b", place="Munich"), cp("c", place="Germany")]
|
||||
assert assign(rows) == {"a": None, "b": None, "c": None}
|
||||
rows = [cp("a", place="Berlin"), cp("b", place="Berlin"), cp("c", place="")]
|
||||
assert assign(rows) == {"a": None, "b": "a", "c": "a"}
|
||||
rows = [cp("a", place=""), cp("b", place="Germany")]
|
||||
assert assign(rows) == {"a": None, "b": "a"}
|
||||
Reference in new issue
Block a user