| 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") |