Preserve no-AST adapter bindings
This commit is contained in:
parent
bb13258861
commit
6c05607b14
7 changed files with 209 additions and 13 deletions
|
|
@ -366,6 +366,7 @@ class AdapterContractTests(unittest.TestCase):
|
|||
self.assertTrue(visual_logic["available"])
|
||||
self.assertEqual("entry", visual_logic["root"])
|
||||
self.assertEqual("return", visual_logic["edges"][0]["relation"])
|
||||
|
||||
loader.extract_calls.clear()
|
||||
cache_path = root / ".cache" / "incremental" / "extractions.json"
|
||||
cache_modified = cache_path.stat().st_mtime_ns
|
||||
|
|
@ -403,6 +404,20 @@ class AdapterContractTests(unittest.TestCase):
|
|||
index.get_node("guide.workflow")["node"]["source_path"],
|
||||
)
|
||||
|
||||
def test_no_ast_index_policy_rejects_logic_publication(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
root = Path(directory).resolve()
|
||||
project = AdapterProject(
|
||||
IncrementalLoader(root),
|
||||
cache_root=root / ".cache" / "no-ast",
|
||||
)
|
||||
|
||||
with self.assertRaises(DocForgeError) as captured:
|
||||
ProjectIndex(project, allow_logic=False).build()
|
||||
|
||||
self.assertEqual("adapter_policy_forbids_logic", captured.exception.code)
|
||||
self.assertFalse(project.descriptor.index_path.exists())
|
||||
|
||||
def test_fast_incremental_reads_reverify_a_changed_index_file(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
root = Path(directory).resolve()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue