예제 #1
0
def test_format_dims_unsafe_dim_name():
    dims, coord_names = {"<x>": 3, "y": 2}, []
    formatted = fh.format_dims(dims, coord_names)
    assert "&lt;x&gt;" in formatted
예제 #2
0
def test_format_dims_index():
    dims, coord_names = {"x": 3, "y": 2}, ["x"]
    formatted = fh.format_dims(dims, coord_names)
    assert "class='xr-has-index'" in formatted
예제 #3
0
def test_format_dims_index() -> None:
    dims, dims_with_index = {"x": 3, "y": 2}, ["x"]
    formatted = fh.format_dims(dims, dims_with_index)
    assert "class='xr-has-index'" in formatted
예제 #4
0
def test_format_dims_no_dims():
    dims, coord_names = {}, []
    formatted = fh.format_dims(dims, coord_names)
    assert formatted == ""
예제 #5
0
def test_format_dims_unsafe_dim_name() -> None:
    dims = {"<x>": 3, "y": 2}
    dims_with_index: list = []
    formatted = fh.format_dims(dims, dims_with_index)
    assert "&lt;x&gt;" in formatted
예제 #6
0
def test_format_dims_no_dims() -> None:
    dims: dict = {}
    dims_with_index: list = []
    formatted = fh.format_dims(dims, dims_with_index)
    assert formatted == ""
예제 #7
0
def test_format_dims_non_index() -> None:
    dims, coord_names = {"x": 3, "y": 2}, ["time"]
    formatted = fh.format_dims(dims, coord_names)
    assert "class='xr-has-index'" not in formatted
예제 #8
0
def test_format_dims_unsafe_dim_name() -> None:
    dims = {"<x>": 3, "y": 2}
    coord_names: List = []
    formatted = fh.format_dims(dims, coord_names)
    assert "&lt;x&gt;" in formatted
예제 #9
0
def test_format_dims_no_dims() -> None:
    dims: Dict = {}
    coord_names: List = []
    formatted = fh.format_dims(dims, coord_names)
    assert formatted == ""