示例#1
0
def test_as_list_of_tuples(to_list):
    expected = [
        ("RasterModelGrid", "raster_data"),
        ("hex_model_grid", "hex_data"),
        ("radial_model_grid", "radial_data"),
    ]
    grid_list = to_list(expected)
    assert as_list_of_tuples(grid_list) == expected
示例#2
0
def test_as_list_of_tuples(to_list):
    expected = [
        ("RasterModelGrid", "raster_data"),
        ("hex_model_grid", "hex_data"),
        ("radial_model_grid", "radial_data"),
    ]
    grid_list = to_list(expected)
    assert as_list_of_tuples(grid_list) == expected
示例#3
0
def test_as_list_of_tuples_mixed_types():
    expected = [
        ("RasterModelGrid", "raster_data"),
        ("hex_model_grid", "hex_data"),
        ("radial_model_grid", "radial_data"),
    ]
    grid_list = [
        ("RasterModelGrid", "raster_data"),
        OrderedDict([("hex_model_grid", "hex_data"),
                     ("radial_model_grid", "radial_data")]),
    ]
    assert as_list_of_tuples(grid_list) == expected
示例#4
0
def test_as_list_of_tuples_mixed_types():
    expected = [
        ("RasterModelGrid", "raster_data"),
        ("hex_model_grid", "hex_data"),
        ("radial_model_grid", "radial_data"),
    ]
    grid_list = [
        ("RasterModelGrid", "raster_data"),
        OrderedDict(
            [("hex_model_grid", "hex_data"), ("radial_model_grid", "radial_data")]
        ),
    ]
    assert as_list_of_tuples(grid_list) == expected
示例#5
0
def test_as_list_of_tuples_just_one():
    assert as_list_of_tuples(("foo", "bar")) == [("foo", "bar")]
    assert as_list_of_tuples(["foo", "bar"]) == [("foo", "bar")]
    assert as_list_of_tuples({"foo": "bar"}) == [("foo", "bar")]
示例#6
0
def test_as_list_of_tuples_just_one():
    assert as_list_of_tuples(("foo", "bar")) == [("foo", "bar")]
    assert as_list_of_tuples(["foo", "bar"]) == [("foo", "bar")]
    assert as_list_of_tuples({"foo": "bar"}) == [("foo", "bar")]