test(content-build): assert candidate entries excluded from build_trees
This commit is contained in:
@@ -3,7 +3,7 @@ from pathlib import Path
|
||||
import pytest
|
||||
|
||||
from content_build.emit import build_trees, check_secrecy, write_trees, dump_json
|
||||
from content_build.model import entry_from_raw
|
||||
from content_build.model import entry_from_raw, Entry
|
||||
from content_build.parse import parse_bible
|
||||
from content_build.resolve import resolve
|
||||
from content_build.errors import BuildError
|
||||
@@ -62,3 +62,14 @@ def test_write_trees_serializes_deterministically(tmp_path):
|
||||
write_trees(client, server, tmp_path / "world", tmp_path / "server")
|
||||
written = (tmp_path / "world" / "npcs" / "tess.json").read_text()
|
||||
assert written == dump_json(client["npcs/tess.json"])
|
||||
|
||||
|
||||
def test_candidate_entries_are_excluded_from_both_trees():
|
||||
world = _world()
|
||||
world.entries.append(Entry(id="town.draft", type="town", status="candidate",
|
||||
secrecy=0, related=[], body="draft town",
|
||||
source="t:99"))
|
||||
client, server = build_trees(world)
|
||||
# a candidate entry ships in NEITHER tree
|
||||
assert "canon/draft.json" not in client
|
||||
assert all("draft" not in relpath for relpath in list(client) + list(server))
|
||||
|
||||
Reference in New Issue
Block a user