Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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")]
Esempio n. 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")]