feat: use canonical TOML path strings

This commit is contained in:
lda
2026-06-27 15:24:34 +07:00 Verified
parent 4b03f54a1d
commit 5cfe513efc
29 changed files with 431 additions and 421 deletions
+4 -13
View File
@@ -14,12 +14,9 @@ def test_condition_dsl_compiles_to_core_condition() -> None:
dumped = condition.to_condition().model_dump(mode="json")
assert dumped["op"] == "and"
assert dumped["args"][0]["left"]["path"] == {
"root": "state",
"parts": ["should_email"],
}
assert dumped["args"][0]["left"]["path"] == "state.should_email"
assert dumped["args"][0]["right"]["value"] is True
assert dumped["args"][1]["path"] == {"root": "state", "parts": ["summary"]}
assert dumped["args"][1]["path"] == "state.summary"
def test_condition_dsl_compiles_authoring_paths_to_typed_core_paths() -> None:
@@ -31,16 +28,10 @@ def test_condition_dsl_compiles_authoring_paths_to_typed_core_paths() -> None:
assert isinstance(comparison.right, PathOperand)
assert comparison.left.path == GraphSourcePath.state("score")
assert comparison.right.path == GraphSourcePath.state("threshold")
assert comparison.model_dump(mode="json")["left"]["path"] == {
"root": "state",
"parts": ["score"],
}
assert comparison.model_dump(mode="json")["left"]["path"] == "state.score"
assert isinstance(existence, ExistsCondition)
assert existence.path == GraphSourcePath.state("summary")
assert existence.model_dump(mode="json")["path"] == {
"root": "state",
"parts": ["summary"],
}
assert existence.model_dump(mode="json")["path"] == "state.summary"
def test_condition_dsl_supports_not_ge_and_ne() -> None: