Skip to content

Commit 44fcd27

Browse files
committed
test: consolidate per-suffix regex tests into representative checks
1 parent 54c521a commit 44fcd27

1 file changed

Lines changed: 8 additions & 95 deletions

File tree

‎tests/test_patronymic_order.py‎

Lines changed: 8 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -3,126 +3,39 @@
33
from tests.base import HumanNameTestBase
44

55

6-
def test_latin_patronymic_matches_ovich() -> None:
6+
def test_latin_patronymic_matches() -> None:
7+
# One common suffix and one irregular — the integration tests cover the rest.
78
C = Constants()
89
assert C.regexes.patronymic.search("Ivanovich")
9-
10-
11-
def test_latin_patronymic_matches_ovna() -> None:
12-
C = Constants()
13-
assert C.regexes.patronymic.search("Ivanovna")
14-
15-
16-
def test_latin_patronymic_matches_evich() -> None:
17-
C = Constants()
18-
assert C.regexes.patronymic.search("Sergeevich")
19-
20-
21-
def test_latin_patronymic_matches_evna() -> None:
22-
C = Constants()
23-
assert C.regexes.patronymic.search("Sergeevna")
24-
25-
26-
def test_latin_patronymic_matches_ichna() -> None:
27-
C = Constants()
28-
assert C.regexes.patronymic.search("Nikitichna")
29-
30-
31-
def test_latin_patronymic_matches_special_ilyich() -> None:
32-
C = Constants()
3310
assert C.regexes.patronymic.search("Ilyich")
3411

3512

36-
def test_latin_patronymic_matches_special_kuzmich() -> None:
37-
C = Constants()
38-
assert C.regexes.patronymic.search("Kuzmich")
39-
40-
41-
def test_latin_patronymic_matches_special_lukich() -> None:
42-
C = Constants()
43-
assert C.regexes.patronymic.search("Lukich")
44-
45-
46-
def test_latin_patronymic_matches_special_fomich() -> None:
47-
C = Constants()
48-
assert C.regexes.patronymic.search("Fomich")
49-
50-
51-
def test_latin_patronymic_matches_special_fokich() -> None:
52-
C = Constants()
53-
assert C.regexes.patronymic.search("Fokich")
54-
55-
5613
def test_latin_patronymic_rejects_non_patronymic() -> None:
5714
# EMPTY_REGEX (the default for missing keys) matches everything,
5815
# so this test is red until the real pattern is in place.
5916
C = Constants()
6017
assert not C.regexes.patronymic.search("Smith")
6118

6219

63-
def test_latin_patronymic_matches_surname_with_patronymic_suffix() -> None:
64-
# Surnames that end in a patronymic suffix also match the regex;
65-
# the end-anchor does not prevent this.
66-
# Separate guard tests verify the *parser* doesn't reorder it incorrectly.
20+
def test_latin_patronymic_end_anchored() -> None:
21+
# A surname ending in a patronymic suffix matches; the end-anchor does not
22+
# prevent this. The parser guard tests verify reordering is suppressed.
6723
C = Constants()
6824
assert C.regexes.patronymic.search("Abramovich")
6925

7026

71-
def test_cyrillic_patronymic_matches_ovich() -> None:
27+
def test_cyrillic_patronymic_matches() -> None:
28+
# One common suffix and one irregular.
7229
C = Constants()
7330
assert C.regexes.patronymic_cyrillic.search("Иванович")
74-
75-
76-
def test_cyrillic_patronymic_matches_ovna() -> None:
77-
C = Constants()
78-
assert C.regexes.patronymic_cyrillic.search("Ивановна")
31+
assert C.regexes.patronymic_cyrillic.search("ильич")
7932

8033

8134
def test_cyrillic_patronymic_rejects_non_patronymic() -> None:
8235
C = Constants()
8336
assert not C.regexes.patronymic_cyrillic.search("Иванов")
8437

8538

86-
def test_cyrillic_patronymic_matches_evich() -> None:
87-
C = Constants()
88-
assert C.regexes.patronymic_cyrillic.search("Сергеевич")
89-
90-
91-
def test_cyrillic_patronymic_matches_evna() -> None:
92-
C = Constants()
93-
assert C.regexes.patronymic_cyrillic.search("Сергеевна")
94-
95-
96-
def test_cyrillic_patronymic_matches_ichna() -> None:
97-
C = Constants()
98-
assert C.regexes.patronymic_cyrillic.search("Никитична")
99-
100-
101-
def test_cyrillic_patronymic_matches_special_ilyich() -> None:
102-
C = Constants()
103-
assert C.regexes.patronymic_cyrillic.search("ильич")
104-
105-
106-
def test_cyrillic_patronymic_matches_special_kuzmich() -> None:
107-
C = Constants()
108-
assert C.regexes.patronymic_cyrillic.search("кузьмич")
109-
110-
111-
def test_cyrillic_patronymic_matches_special_lukich() -> None:
112-
C = Constants()
113-
assert C.regexes.patronymic_cyrillic.search("лукич")
114-
115-
116-
def test_cyrillic_patronymic_matches_special_fomich() -> None:
117-
C = Constants()
118-
assert C.regexes.patronymic_cyrillic.search("фомич")
119-
120-
121-
def test_cyrillic_patronymic_matches_special_fokich() -> None:
122-
C = Constants()
123-
assert C.regexes.patronymic_cyrillic.search("фокич")
124-
125-
12639
class PatronymicNameOrderReorderTests(HumanNameTestBase):
12740
"""Names that SHOULD be rotated when the flag is on."""
12841

0 commit comments

Comments
 (0)