Spaces:
Running on Zero
Running on Zero
test: cover held-out COLMAP requirement
Browse files- tests/test_import_colmap.py +12 -0
tests/test_import_colmap.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import json
|
|
|
|
| 2 |
|
| 3 |
from import_colmap import import_colmap
|
| 4 |
from validate_capture_manifest import validate_capture_manifest
|
|
@@ -34,3 +35,14 @@ def test_import_colmap_rejects_unknown_camera_model(tmp_path):
|
|
| 34 |
assert "unsupported COLMAP camera model" in str(exc)
|
| 35 |
else:
|
| 36 |
raise AssertionError("unknown camera model should fail")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import json
|
| 2 |
+
from unittest.mock import patch
|
| 3 |
|
| 4 |
from import_colmap import import_colmap
|
| 5 |
from validate_capture_manifest import validate_capture_manifest
|
|
|
|
| 35 |
assert "unsupported COLMAP camera model" in str(exc)
|
| 36 |
else:
|
| 37 |
raise AssertionError("unknown camera model should fail")
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
def test_import_colmap_cli_requires_held_out_split():
|
| 41 |
+
from import_colmap import main
|
| 42 |
+
with patch("import_colmap.Path.is_file", return_value=False):
|
| 43 |
+
try:
|
| 44 |
+
main(["cameras.txt", "images.txt", ".", "capture.json"])
|
| 45 |
+
except SystemExit as exc:
|
| 46 |
+
assert exc.code == 2
|
| 47 |
+
else:
|
| 48 |
+
raise AssertionError("CLI should require held-out views")
|