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

Method test_index_repr_grouping

xarray/tests/test_formatting.py:262–276  ·  view source on GitHub ↗
(self, names)

Source from the content-addressed store, hash-verified

260 ),
261 )
262 def test_index_repr_grouping(self, names) -> None:
263 index = CustomIndex(names)
264
265 normal = formatting.summarize_index(names, index, col_width=20)
266 assert all(name in normal for name in names)
267 assert len(normal.splitlines()) == len(names)
268 assert "CustomIndex" in normal
269
270 hint_chars = [line[2] for line in normal.splitlines()]
271
272 if len(names) <= 1:
273 assert hint_chars == [" "]
274 else:
275 assert hint_chars[0] == "┌" and hint_chars[-1] == "└"
276 assert len(names) == 2 or hint_chars[1:-1] == ["│"] * (len(names) - 2)
277
278 def test_diff_array_repr(self) -> None:
279 da_a = xr.DataArray(

Callers

nothing calls this directly

Calls 1

CustomIndexClass · 0.70

Tested by

no test coverage detected