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

Method test_get_upwards

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

Source from the content-addressed store, hash-verified

169 assert mary._get_item("Sue/Steven") is steven
170
171 def test_get_upwards(self) -> None:
172 john: TreeNode = TreeNode(
173 children={
174 "Mary": TreeNode(children={"Sue": TreeNode(), "Kate": TreeNode()})
175 }
176 )
177 mary = john.children["Mary"]
178 sue = mary.children["Sue"]
179 kate = mary.children["Kate"]
180
181 assert sue._get_item("../") is mary
182 assert sue._get_item("../../") is john
183
184 # relative path
185 assert sue._get_item("../Kate") is kate
186
187 def test_get_from_root(self) -> None:
188 john: TreeNode = TreeNode(

Callers

nothing calls this directly

Calls 2

TreeNodeClass · 0.90
_get_itemMethod · 0.80

Tested by

no test coverage detected