mirror of
https://github.com/Dasemu/faust-vn.git
synced 2026-11-26 15:26:20 +00:00
feat: add deterministic text stage (fetch, scope cut, parser) with tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
10af4346f6
commit
fdfe6d057e
9 files changed
+8589
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import pytest
|
||||
|
||||
from vnpipe.schema import SchemaError, validate
|
||||
|
||||
|
||||
def test_valid_instance_passes():
|
||||
validate(
|
||||
{
|
||||
"work": "x",
|
||||
"source_sha256": "a" * 64,
|
||||
"scenes": [{"id": "s", "heading": "H", "lines": []}],
|
||||
},
|
||||
"parsed",
|
||||
)
|
||||
|
||||
|
||||
def test_reports_all_problems():
|
||||
with pytest.raises(SchemaError) as exc:
|
||||
validate({"work": 1, "source_sha256": "bad", "scenes": []}, "parsed")
|
||||
message = str(exc.value)
|
||||
assert "3 problem(s)" in message
|
||||
assert "/work" in message and "/source_sha256" in message and "/scenes" in message
|
||||
|
||||
|
||||
def test_unknown_schema():
|
||||
with pytest.raises(FileNotFoundError):
|
||||
validate({}, "nope")
|
||||
Reference in new issue
Block a user