mirror of
https://github.com/Dasemu/vnpipe.git
synced 2026-11-26 07:16:23 +00:00
Generic "classic novels to visual novels" pipeline extracted from faust-vn (source commit 6486ab1). The work-specific data (Faust text, annotations, assets, generated project) stays in faust-vn. Changes versus the source: --work defaults to the current directory, the renpy command writes to <work root>/vn, the Ren'Py SDK is located through RENPY_SDK, and tests only use fixtures. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
28 lines
699 B
Python
28 lines
699 B
Python
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")
|