feat: use canonical TOML path strings
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user