(self)
| 76 | Coordinates(coords={"foo": ("x", [1, 2]), "bar": ("x", [1, 2, 3, 4])}) |
| 77 | |
| 78 | def test_from_xindex(self) -> None: |
| 79 | idx = PandasIndex([1, 2, 3], "x") |
| 80 | coords = Coordinates.from_xindex(idx) |
| 81 | |
| 82 | assert isinstance(coords.xindexes["x"], PandasIndex) |
| 83 | assert coords.xindexes["x"].equals(idx) |
| 84 | |
| 85 | expected = PandasIndex(idx, "x").create_variables() |
| 86 | assert list(coords.variables) == list(expected) |
| 87 | assert_identical(expected["x"], coords.variables["x"]) |
| 88 | |
| 89 | def test_from_xindex_error(self) -> None: |
| 90 | class CustomIndexNoCoordsGenerated(Index): |
nothing calls this directly
no test coverage detected