|
3 | 3 | from tests.base import HumanNameTestBase |
4 | 4 |
|
5 | 5 |
|
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. |
7 | 8 | C = Constants() |
8 | 9 | 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() |
33 | 10 | assert C.regexes.patronymic.search("Ilyich") |
34 | 11 |
|
35 | 12 |
|
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 | | - |
56 | 13 | def test_latin_patronymic_rejects_non_patronymic() -> None: |
57 | 14 | # EMPTY_REGEX (the default for missing keys) matches everything, |
58 | 15 | # so this test is red until the real pattern is in place. |
59 | 16 | C = Constants() |
60 | 17 | assert not C.regexes.patronymic.search("Smith") |
61 | 18 |
|
62 | 19 |
|
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. |
67 | 23 | C = Constants() |
68 | 24 | assert C.regexes.patronymic.search("Abramovich") |
69 | 25 |
|
70 | 26 |
|
71 | | -def test_cyrillic_patronymic_matches_ovich() -> None: |
| 27 | +def test_cyrillic_patronymic_matches() -> None: |
| 28 | + # One common suffix and one irregular. |
72 | 29 | C = Constants() |
73 | 30 | 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("ильич") |
79 | 32 |
|
80 | 33 |
|
81 | 34 | def test_cyrillic_patronymic_rejects_non_patronymic() -> None: |
82 | 35 | C = Constants() |
83 | 36 | assert not C.regexes.patronymic_cyrillic.search("Иванов") |
84 | 37 |
|
85 | 38 |
|
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 | | - |
126 | 39 | class PatronymicNameOrderReorderTests(HumanNameTestBase): |
127 | 40 | """Names that SHOULD be rotated when the flag is on.""" |
128 | 41 |
|
|
0 commit comments