Add tests directory
Browse files- tests/smoke_test.py +19 -0
tests/smoke_test.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import sys, pathlib
|
| 2 |
+
sys.path.insert(0, str(pathlib.Path(__file__).parent.parent))
|
| 3 |
+
from pathlib import Path
|
| 4 |
+
from src.core.models import JobConfig
|
| 5 |
+
from src.core.orchestrator import OfflinePDFOrchestrator
|
| 6 |
+
|
| 7 |
+
def test_init(tmp_path):
|
| 8 |
+
orc = OfflinePDFOrchestrator(work_dir=tmp_path)
|
| 9 |
+
cfg = JobConfig(input_pdf=tmp_path / "x.pdf", output_dir=tmp_path / "out")
|
| 10 |
+
assert cfg.job_id
|
| 11 |
+
assert cfg.pipeline == "full_document"
|
| 12 |
+
assert "full_document" in orc.list_available_pipelines()
|
| 13 |
+
assert "text_edit" in orc.list_available_pipelines()
|
| 14 |
+
print("Smoke test passed")
|
| 15 |
+
|
| 16 |
+
if __name__ == "__main__":
|
| 17 |
+
import tempfile
|
| 18 |
+
with tempfile.TemporaryDirectory() as t:
|
| 19 |
+
test_init(Path(t))
|