Skip to content

Commit 86c53e8

Browse files
committed
test_cli update & test_config issue with transit_distance fixed
1 parent 9cfd585 commit 86c53e8

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

tests/fixtures/test_config.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@
3737
]
3838
},
3939

40-
"object_features": ["units", "transit_distance", "levels", "area", "floor_area"],
40+
"object_features": ["units", "levels", "area", "floor_area"],
41+
42+
"distance_to_nearest": ["transit"],
4143

4244
"default_tags": [["building", "residential"]],
4345

tests/test_cli.py

+11-10
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import pytest
66
from click.testing import CliRunner
7+
78
from osmox import cli
89

910
logging.basicConfig(level=logging.INFO)
@@ -21,7 +22,7 @@ def config_path(fixtures_root):
2122

2223
@pytest.fixture
2324
def toy_osm_path(fixtures_root):
24-
return os.path.join(fixtures_root, "park.osm")
25+
return os.path.join(fixtures_root, "toy.osm")
2526

2627

2728
@pytest.fixture
@@ -41,14 +42,14 @@ def test_cli_with_default_args(runner, config_path, toy_osm_path):
4142
result = runner.invoke(cli.run, [config_path, toy_osm_path, "output_test"])
4243

4344
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
4646

4747

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

Comments
 (0)