Spaces:
Paused
Paused
test: cover homogeneous matrix validation
Browse files
tests/test_validate_capture_manifest.py
CHANGED
|
@@ -40,3 +40,16 @@ def test_capture_manifest_rejects_duplicate_ids(tmp_path):
|
|
| 40 |
valid, errors = validate_capture_manifest(manifest)
|
| 41 |
assert valid is False
|
| 42 |
assert any("duplicate" in error for error in errors)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
valid, errors = validate_capture_manifest(manifest)
|
| 41 |
assert valid is False
|
| 42 |
assert any("duplicate" in error for error in errors)
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
def test_capture_manifest_rejects_malformed_homogeneous_matrices(tmp_path):
|
| 46 |
+
bad = _record("a", "train")
|
| 47 |
+
bad["intrinsics"][2] = [0, 1, 0]
|
| 48 |
+
other = _record("b", "held_out")
|
| 49 |
+
other["extrinsics"][3] = [0, 0, 0, 2]
|
| 50 |
+
manifest = tmp_path / "capture.json"
|
| 51 |
+
manifest.write_text(json.dumps({"project": "Simam3D", "views": [bad, other]}), encoding="utf-8")
|
| 52 |
+
valid, errors = validate_capture_manifest(manifest)
|
| 53 |
+
assert valid is False
|
| 54 |
+
assert any("intrinsics bottom row" in error for error in errors)
|
| 55 |
+
assert any("extrinsics bottom row" in error for error in errors)
|