ver1 - Step 5 implementation complete.

This commit is contained in:
Jim Lancaster
2026-06-26 17:51:02 -05:00
parent c9682b0399
commit e90dbe4958
16 changed files with 474 additions and 45 deletions
+18
View File
@@ -41,6 +41,24 @@ class TestUploadValidation:
assert exc_info.value.category.value == "user_input_error"
assert "jpg" in exc_info.value.suggestion.lower()
def test_rejects_payload_exceeding_max_upload_bytes(self, session, tmp_path: Path):
"""create_upload_job rejects payloads above configured size limit."""
settings = Settings(
openrouter_api_key="test-key",
upload_dir=tmp_path,
max_upload_bytes=3,
)
with pytest.raises(UploadError) as exc_info:
create_upload_job(
filename="scan.jpg",
file_bytes=b"1234",
session=session,
settings=settings,
)
assert exc_info.value.category.value == "user_input_error"
assert "smaller file" in exc_info.value.suggestion.lower()
@pytest.mark.integration
class TestUploadPersistence: