Skip to content

Commit 0e08040

Browse files
committed
tests: add type annotations for mypy; ci: enable workflow_dispatch; ruff import order fixes
1 parent 4725814 commit 0e08040

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

tests/cli/test_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from fek_extractor.cli import collect_pdfs
44

55

6-
def test_collect_pdfs(tmp_path: Path):
6+
def test_collect_pdfs(tmp_path: Path) -> None:
77
(tmp_path / "a.pdf").write_bytes(b"%PDF-1.4\n") # stub
88
(tmp_path / "b.txt").write_text("nope")
99
files = collect_pdfs(tmp_path, recursive=False)

tests/unit/test_exports.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from fek_extractor.io.exports import write_csv, write_json
44

55

6-
def test_write_json_and_csv(tmp_path: Path):
6+
def test_write_json_and_csv(tmp_path: Path) -> None:
77
records = [
88
{
99
"path": "x.pdf",

tests/unit/test_headers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from fek_extractor.parsing.headers import find_fek_header_line, parse_fek_header
44

55

6-
def test_find_and_parse_header_single_line():
6+
def test_find_and_parse_header_single_line() -> None:
77
lines = ["ΚΥΒΕΡΝΗΣΗ ΤΗΣ ΕΛΛΑΔΑΣ", "ΦΕΚ Α 123/01.01.2024", "Κάτω μέρος"]
88
hdr_line = find_fek_header_line(lines)
99
assert hdr_line == "ΦΕΚ Α 123/01.01.2024"
@@ -13,7 +13,7 @@ def test_find_and_parse_header_single_line():
1313
assert fields["fek_date"] == "01.01.2024"
1414

1515

16-
def test_find_header_joined_lines():
16+
def test_find_header_joined_lines() -> None:
1717
lines = ["ΚΥΒΕΡΝΗΣΗ ΤΗΣ ΕΛΛΑΔΑΣ", "ΦΕΚ Α 123/01.01.", "2024 και λοιπά"]
1818
hdr_line = find_fek_header_line(lines)
1919
assert hdr_line is not None

tests/unit/test_normalize.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,48 +6,48 @@
66
)
77

88

9-
def test_normalize_text():
9+
def test_normalize_text() -> None:
1010
s = " A\u00a0test\nwith\tmulti\tspace & entities "
1111
assert normalize_text(s) == "A test with multi space & entities"
1212

1313

14-
def test_dehyphenate_text_newline_join():
14+
def test_dehyphenate_text_newline_join() -> None:
1515
# εφαρμόζο-\nνται => εφαρμόζονται
1616
s = "Αυτό δεν εφαρμόζο-\nνται συχνά."
1717
assert dehyphenate_text(s) == "Αυτό δεν εφαρμόζονται συχνά."
1818

1919

20-
def test_dehyphenate_text_space_join():
20+
def test_dehyphenate_text_space_join() -> None:
2121
# επο- πτικών => εποπτικών
2222
s = "στο πλαίσιο των επο- πτικών αρμοδιοτήτων"
2323
assert dehyphenate_text(s) == "στο πλαίσιο των εποπτικών αρμοδιοτήτων"
2424

2525

26-
def test_dehyphenate_text_preserves_real_hyphens():
26+
def test_dehyphenate_text_preserves_real_hyphens() -> None:
2727
# Should not touch true hyphens with uppercase names
2828
s = "ΣΠΥΡΙΔΩΝ - ΑΔΩΝΙΣ"
2929
assert dehyphenate_text(s) == "ΣΠΥΡΙΔΩΝ - ΑΔΩΝΙΣ"
3030

3131

32-
def test_dehyphenate_text_restores_accent():
32+
def test_dehyphenate_text_restores_accent() -> None:
3333
# μεγα-\nλο => μεγάλο
3434
s = "Αυτό είναι ένα μεγά-\nλο παράδειγμα."
3535
assert dehyphenate_text(s) == "Αυτό είναι ένα μεγάλο παράδειγμα."
3636

3737

38-
def test_dehyphenate_lines_basic():
38+
def test_dehyphenate_lines_basic() -> None:
3939
lines = ["Αυτό είναι ένα μεγά-", "λο κείμενο."]
4040
out = dehyphenate_lines(lines)
4141
assert out == ["Αυτό είναι ένα μεγάλο κείμενο."]
4242

4343

44-
def test_dehyphenate_text_soft_hyphen_with_spaces():
44+
def test_dehyphenate_text_soft_hyphen_with_spaces() -> None:
4545
# Handle soft hyphen + spaces: "διοικη\u00AD τικό" => "διοικητικό"
4646
s = "Το πλαίσιο είναι διοικη\u00ad τικό και σαφές."
4747
assert dehyphenate_text(s) == "Το πλαίσιο είναι διοικητικό και σαφές."
4848

4949

50-
def test_dehyphenate_text_idempotent():
50+
def test_dehyphenate_text_idempotent() -> None:
5151
s = "εφαρμόζο-\nνται επο- πτικών"
5252
once = dehyphenate_text(s)
5353
twice = dehyphenate_text(once)

0 commit comments

Comments
 (0)