4
4
5
5
import pytest
6
6
from click .testing import CliRunner
7
+
7
8
from osmox import cli
8
9
9
10
logging .basicConfig (level = logging .INFO )
@@ -21,7 +22,7 @@ def config_path(fixtures_root):
21
22
22
23
@pytest .fixture
23
24
def toy_osm_path (fixtures_root ):
24
- return os .path .join (fixtures_root , "park .osm" )
25
+ return os .path .join (fixtures_root , "toy .osm" )
25
26
26
27
27
28
@pytest .fixture
@@ -41,14 +42,14 @@ def test_cli_with_default_args(runner, config_path, toy_osm_path):
41
42
result = runner .invoke (cli .run , [config_path , toy_osm_path , "output_test" ])
42
43
43
44
check_exit_code (result )
44
- assert "geopackage" in result .exit_code
45
- assert "epsg:4326" in result .exit_code
45
+ assert result .exit_code == 0
46
46
47
47
48
- def test_cli_output_formats (runner , config_path , toy_osm_path ):
49
- for output_format in ["geojson" , "geopackage" , "geoparquet" ]:
50
- result = runner .invoke (
51
- cli .run ,
52
- [config_path , toy_osm_path , "output_test" , "-f" , output_format , "-crs" , "epsg:4326" ],
53
- )
54
- check_exit_code (result )
48
+ @pytest .mark .parametrize ("output_format" , ["geojson" , "geopackage" , "geoparquet" ])
49
+ def test_cli_output_formats (runner , config_path , toy_osm_path , output_format ):
50
+ result = runner .invoke (
51
+ cli .run ,
52
+ [config_path , toy_osm_path , "output_test" , "-f" , output_format , "-crs" , "epsg:4326" ],
53
+ )
54
+ check_exit_code (result )
55
+ assert result .exit_code == 0
0 commit comments