File size: 709 Bytes
59879a5
 
c1ea3ba
59879a5
 
c1ea3ba
59879a5
 
 
 
c1ea3ba
59879a5
 
 
6e652a3
c1ea3ba
6e652a3
59879a5
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import os
import pytest
from utils import convert, read_file, output_format_dict

input_exts = ["kml", "kmz", "geojson", "zip"]
output_exts = output_format_dict.keys()


@pytest.mark.parametrize("in_ext", input_exts)
@pytest.mark.parametrize("out_ext", output_exts)
def test_coversion(in_ext: str, out_ext: str) -> None:
    test_file = f"test.{in_ext}"
    test_file_path = os.path.join(os.getcwd(), "tests", "test_data", test_file)
    with open(test_file_path, "rb") as f:
        in_file = read_file(f)
    out_file = f"test.{output_format_dict[out_ext][0]}"
    converted_data = convert(in_file, out_file, out_ext)
    with open("test.kml", "wb") as f:
        f.write(converted_data)