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

Method test__title_for_slice_truncate

xarray/tests/test_dataarray.py:4196–4205  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4194 assert "" == a2._title_for_slice()
4195
4196 def test__title_for_slice_truncate(self) -> None:
4197 array = DataArray(np.ones(4))
4198 array.coords["a"] = "a" * 100
4199 array.coords["b"] = "b" * 100
4200
4201 nchar = 80
4202 title = array._title_for_slice(truncate=nchar)
4203
4204 assert nchar == len(title)
4205 assert title.endswith("...")
4206
4207 def test_dataarray_diff_n1(self) -> None:
4208 da = DataArray(np.random.randn(3, 4), dims=["x", "y"])

Callers

nothing calls this directly

Calls 3

_title_for_sliceMethod · 0.95
DataArrayClass · 0.90
endswithMethod · 0.80

Tested by

no test coverage detected