fix: resolve test failures and update flake.nix for factur-x source distribution

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
m3tm3re
2026-02-04 21:08:08 +01:00
parent 3eddd66003
commit d585390289
6 changed files with 223 additions and 41 deletions

View File

@@ -46,20 +46,18 @@ class TestFileSizeValidation:
"""Test file size validation in extract_zugferd()."""
def test_file_size_limit_exactly_10mb(self):
"""Test PDF exactly at 10MB limit is accepted."""
"""Test PDF exactly at 10MB limit passes size check but fails PDF parsing."""
from src.extractor import extract_zugferd, ExtractionError
"""Test PDF exactly at 10MB limit is accepted."""
from src.extractor import extract_zugferd
# 10MB = 10 * 1024 * 1024 bytes
large_pdf = b"X" * (10 * 1024 * 1024)
# Should raise file_too_large error
# 10MB exactly is allowed (not > 10MB), but invalid PDF data causes parse error
with pytest.raises(ExtractionError) as exc_info:
extract_zugferd(large_pdf)
assert exc_info.value.error_code == "file_too_large"
# Should fail PDF parsing, not file size check
assert exc_info.value.error_code in ["corrupt_pdf", "invalid_pdf"]
def test_file_size_limit_10mb_plus_one_byte(self):
"""Test PDF one byte over 10MB limit is rejected."""