Skip to content

Commit

Permalink
test: Update yaml tree test model
Browse files Browse the repository at this point in the history
If any child of a model is not an ASDF pydantic model, the YAML tree will be the return of pydantic's model dump (a dict of native objects).
  • Loading branch information
ketozhang committed Jun 21, 2024
1 parent 09268b6 commit 4f8b06a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion asdf_pydantic/examples/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ class Node(BaseModel):
class AsdfNode(Node, AsdfPydanticModel):
_tag = "asdf://asdf-pydantic/examples/tags/node-1.0.0"

child: Optional[Union[Node, AsdfNode]] = None
child: Optional[Union[AsdfNode, Node]] = None
2 changes: 1 addition & 1 deletion tests/convert_to_asdf_yaml_tree_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ def test_given_mix_child_is_mix_of_AsdfNode_and_Node():
}

assert AsdfNode(child=Node(child=AsdfNode())).asdf_yaml_tree() == {
"child": {"child": AsdfNode()}
"child": {"child": {"child": None}}
}

0 comments on commit 4f8b06a

Please sign in to comment.