Mark a role whose title or text says remote while no field does, in prep with no model, and let it meet a gate on remote until extract has read it (migration 35, roles.remote_text)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
f141cffc3c
commit
49929372c7
14 files changed
+144
-36
No files matched your search
+26
-2
@@ -224,7 +224,31 @@ def test_the_model_level_and_remote_win_over_the_host_and_the_place_line(
|
||||
("senior", "lead", "onsite")
|
||||
|
||||
|
||||
def test_the_company_resolves_through_its_aliases(store: Store) -> None:
|
||||
def test_remote_in_the_text_is_marked_and_a_denial_is_not() -> None:
|
||||
yes = ("Fully-remote within the EU, we meet twice a year.",
|
||||
"Work from home or from our Berlin office, as you like.",
|
||||
"Dette er en stilling med mulighed for fjernarbejde.")
|
||||
no = ("No remote work: this role is on site in Munich.",
|
||||
"Remote sensing analyst for our satellite team.",
|
||||
"A great office in Copenhagen with free lunch.")
|
||||
assert all(words.remote_in_text("Engineer", text) for text in yes)
|
||||
assert not any(words.remote_in_text("Engineer", text) for text in no)
|
||||
assert words.remote_in_text("Backend Developer, remote-first team", "")
|
||||
|
||||
|
||||
def test_prep_marks_a_role_whose_text_says_remote(store: Store) -> None:
|
||||
said = item("1", title="Engineer", place="Berlin")
|
||||
said.body = "Fully remote within Germany, with a Berlin office."
|
||||
silent = item("2", title="Engineer", place="Berlin")
|
||||
silent.body = "On site in Berlin."
|
||||
store.upsert_role(said)
|
||||
store.upsert_role(silent)
|
||||
prep.run(store, tables=TABLES)
|
||||
assert (row(store, "1")["remote"], row(store, "1")["remote_text"]) == ("", 1)
|
||||
assert (row(store, "2")["remote"], row(store, "2")["remote_text"]) == ("", 0)
|
||||
|
||||
|
||||
|
||||
store.add_company("Ørsted")
|
||||
store.upsert_role(item("1", company="ORSTED A/S"))
|
||||
assert row(store, "1")["company_key"] != "ørsted"
|
||||
@@ -316,7 +340,7 @@ def test_migration_22_fills_the_host_words_from_raw(tmp_path: Path) -> None:
|
||||
|
||||
migrated = Store(path)
|
||||
|
||||
assert migrated.migrations_applied == [22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34]
|
||||
assert migrated.migrations_applied == [22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35]
|
||||
one = row(migrated, "1")
|
||||
assert (one["seniority_host"], one["employment_host"], one["remote_host"],
|
||||
one["country_host"]) == ("senior", "full_time", "true", "DK")
|
||||
|
||||
Reference in new issue
Block a user