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

Method test_sel

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

Source from the content-addressed store, hash-verified

221 assert index.to_pandas_index() is index.index
222
223 def test_sel(self) -> None:
224 # TODO: add tests that aren't just for edge cases
225 index = PandasIndex(pd.Index([1, 2, 3]), "x")
226 with pytest.raises(KeyError, match=r"not all values found"):
227 index.sel({"x": [0]})
228 with pytest.raises(KeyError):
229 index.sel({"x": 0})
230 with pytest.raises(ValueError, match=r"does not have a MultiIndex"):
231 index.sel({"x": {"one": 0}})
232
233 def test_sel_boolean(self) -> None:
234 # index should be ignored and indexer dtype should not be coerced

Callers

nothing calls this directly

Calls 2

selMethod · 0.95
PandasIndexClass · 0.90

Tested by

no test coverage detected