junaid-simamdigital commited on
Commit
e8e732b
·
verified ·
1 Parent(s): fba788b

Sync manifest diagnostics tests

Browse files
Files changed (1) hide show
  1. tests/test_manifest_validator.py +19 -0
tests/test_manifest_validator.py CHANGED
@@ -131,3 +131,22 @@ def test_manifest_validator_resolves_relative_nested_artifacts(tmp_path):
131
  artifact.unlink(missing_ok=True)
132
  manifest.unlink(missing_ok=True)
133
  artifact.parent.rmdir()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
  artifact.unlink(missing_ok=True)
132
  manifest.unlink(missing_ok=True)
133
  artifact.parent.rmdir()
134
+
135
+
136
+ def test_manifest_validator_reports_malformed_numeric_fields(tmp_path):
137
+ artifact = tmp_path / "artifact.bin"
138
+ artifact.write_bytes(b"artifact")
139
+ manifest = tmp_path / "malformed.json"
140
+ manifest.write_text(
141
+ '{"project":"Simam3D","manifest_schema_version":"not-a-number",'
142
+ '"version":"0.4.7","view_count":"also-invalid",'
143
+ '"claims":{"observed_input_geometry":true,"generated_novel_views":false,'
144
+ '"metric_scale_reconstruction":false,"learned_gaussian_optimization":false,'
145
+ '"reveal_content_is_verified":false},'
146
+ f'"outputs":["{artifact.name}"],"output_sha256":{{"{artifact.name}":"{file_sha256(artifact)}"}}}}',
147
+ encoding="utf-8",
148
+ )
149
+ valid, errors = validate_manifest(manifest)
150
+ assert not valid
151
+ assert any("manifest schema" in error for error in errors)
152
+ assert any("input diversity view count" in error for error in errors)