Beispiel #1
0
    def test_redundant_nesting(self):
        ds = create_test_data
        input = [[ds(0)], [ds(1)]]

        expected = {(0, 0): ds(0), (1, 0): ds(1)}
        actual = dict(_infer_tile_ids_from_nested_list(input, ()))
        assert_combined_tile_ids_equal(expected, actual)
Beispiel #2
0
    def test_1d(self):
        ds = create_test_data
        input = [ds(0), ds(1)]

        expected = {(0, ): ds(0), (1, ): ds(1)}
        actual = dict(_infer_tile_ids_from_nested_list(input, ()))
        assert_combined_tile_ids_equal(expected, actual)
Beispiel #3
0
    def test_single_dataset(self):
        ds = create_test_data(0)
        input = [ds]

        expected = {(0, ): ds}
        actual = dict(_infer_tile_ids_from_nested_list(input, ()))
        assert_combined_tile_ids_equal(expected, actual)
Beispiel #4
0
    def test_redundant_nesting(self):
        ds = create_test_data
        input = [[ds(0)], [ds(1)]]

        expected = {(0, 0): ds(0), (1, 0): ds(1)}
        actual = dict(_infer_tile_ids_from_nested_list(input, ()))
        assert_combined_tile_ids_equal(expected, actual)
Beispiel #5
0
    def test_single_dataset(self):
        ds = create_test_data(0)
        input = [ds]

        expected = {(0,): ds}
        actual = dict(_infer_tile_ids_from_nested_list(input, ()))
        assert_combined_tile_ids_equal(expected, actual)
Beispiel #6
0
    def test_1d(self):
        ds = create_test_data
        input = [ds(0), ds(1)]

        expected = {(0,): ds(0), (1,): ds(1)}
        actual = dict(_infer_tile_ids_from_nested_list(input, ()))
        assert_combined_tile_ids_equal(expected, actual)
Beispiel #7
0
    def test_uneven_length_input(self):
        # Auto_combine won't work on ragged input
        # but this is just to increase test coverage
        ds = create_test_data
        input = [[ds(0)], [ds(1), ds(2)]]

        expected = {(0, 0): ds(0), (1, 0): ds(1), (1, 1): ds(2)}
        actual = dict(_infer_tile_ids_from_nested_list(input, ()))
        assert_combined_tile_ids_equal(expected, actual)
Beispiel #8
0
    def test_uneven_length_input(self):
        # Auto_combine won't work on ragged input
        # but this is just to increase test coverage
        ds = create_test_data
        input = [[ds(0)], [ds(1), ds(2)]]

        expected = {(0, 0): ds(0), (1, 0): ds(1), (1, 1): ds(2)}
        actual = dict(_infer_tile_ids_from_nested_list(input, ()))
        assert_combined_tile_ids_equal(expected, actual)
Beispiel #9
0
    def test_2d(self):
        ds = create_test_data
        input = [[ds(0), ds(1)], [ds(2), ds(3)], [ds(4), ds(5)]]

        expected = {(0, 0): ds(0), (0, 1): ds(1),
                    (1, 0): ds(2), (1, 1): ds(3),
                    (2, 0): ds(4), (2, 1): ds(5)}
        actual = dict(_infer_tile_ids_from_nested_list(input, ()))
        assert_combined_tile_ids_equal(expected, actual)