-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_poll_identity.py
More file actions
45 lines (30 loc) · 1.87 KB
/
Copy pathtest_poll_identity.py
File metadata and controls
45 lines (30 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"""Direct unit tests for `poll.identity` (roadmap M4, ADR-0031)."""
from __future__ import annotations
from openjobradar.poll.identity import ats_board_matches_org, employer_names_match
class TestEmployerNamesMatch:
def test_exact_match(self) -> None:
assert employer_names_match("Acme Corp", "Acme Corp") is True
def test_case_and_legal_suffix_insensitive(self) -> None:
assert employer_names_match("Acme Corp", "ACME, Inc.") is True
def test_containment_when_shorter_name_is_a_real_prefix(self) -> None:
assert employer_names_match("Acme", "Acme Robotics") is True
def test_initials_match_for_multi_word_names(self) -> None:
assert employer_names_match("East Bay Community Energy", "EBCE") is True
def test_rejects_unrelated_names(self) -> None:
assert employer_names_match("Acme Corp", "Totally Different Company") is False
def test_rejects_single_shared_word(self) -> None:
assert employer_names_match("Bay Area Rapid Transit", "Bay Street Bakery") is False
def test_empty_inputs_never_match(self) -> None:
assert employer_names_match("", "Acme") is False
assert employer_names_match("Acme", "") is False
class TestAtsBoardMatchesOrg:
def test_single_word_brand_matches_board_token(self) -> None:
assert ats_board_matches_org("Acme", "acme") is True
def test_multi_word_name_matches_compact_board_token(self) -> None:
assert ats_board_matches_org("Acme Robotics", "acmerobotics") is True
def test_initials_match_board_token(self) -> None:
assert ats_board_matches_org("East Bay Community Energy", "ebce") is True
def test_rejects_unrelated_board_token(self) -> None:
assert ats_board_matches_org("Acme Robotics", "totallydifferent") is False
def test_empty_name_never_matches(self) -> None:
assert ats_board_matches_org("", "acme") is False