MCPcopy
hub / github.com/pydata/xarray / test_attribute_repr

Method test_attribute_repr

xarray/tests/test_formatting.py:223–232  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

221 assert result == expected
222
223 def test_attribute_repr(self) -> None:
224 short = formatting.summarize_attr("key", "Short string")
225 long = formatting.summarize_attr("key", 100 * "Very long string ")
226 newlines = formatting.summarize_attr("key", "\n\n\n")
227 tabs = formatting.summarize_attr("key", "\t\t\t")
228 assert short == " key: Short string"
229 assert len(long) <= 80
230 assert long.endswith("...")
231 assert "\n" not in newlines
232 assert "\t" not in tabs
233
234 def test_index_repr(self) -> None:
235 coord_names = ("x", "y")

Callers

nothing calls this directly

Calls 1

endswithMethod · 0.80

Tested by

no test coverage detected