MCPcopy Create free account
hub / github.com/pydata/xarray / test_copy_subtree

Method test_copy_subtree

xarray/tests/test_treenode.py:121–128  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

119 assert "Kate" not in kate.siblings
120
121 def test_copy_subtree(self) -> None:
122 tony: TreeNode = TreeNode()
123 michael: TreeNode = TreeNode(children={"Tony": tony})
124 vito = TreeNode(children={"Michael": michael})
125
126 # check that children of assigned children are also copied (i.e. that ._copy_subtree works)
127 copied_tony = vito.children["Michael"].children["Tony"]
128 assert copied_tony is not tony
129
130 def test_parents(self) -> None:
131 vito: TreeNode = TreeNode(

Callers

nothing calls this directly

Calls 1

TreeNodeClass · 0.90

Tested by

no test coverage detected