MCPcopy Index your code
hub / github.com/pydata/xarray / test_different_structure

Method test_different_structure

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

Source from the content-addressed store, hash-verified

355 assert [path for path, _ in group_subtrees(first, second)] == [".", "b", "c"]
356
357 def test_different_structure(self) -> None:
358 first: NamedNode = NamedNode(name="a", children={"b": NamedNode()})
359 second: NamedNode = NamedNode(name="a", children={"c": NamedNode()})
360 it = group_subtrees(first, second)
361
362 path, (node1, node2) = next(it)
363 assert path == "."
364 assert node1.name == node2.name == "a"
365
366 with pytest.raises(
367 ValueError,
368 match=re.escape(r"children at root node do not match: ['b'] vs ['c']"),
369 ):
370 next(it)
371
372
373class TestAncestry:

Callers

nothing calls this directly

Calls 2

NamedNodeClass · 0.90
group_subtreesFunction · 0.90

Tested by

no test coverage detected