From 114274f900904070e941c4a544426b5d9d1267d2 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Fri, 31 Mar 2023 23:57:59 +0200 Subject: hide ugliness of tile url function We basically do the same hacky trick in two different places, so maybe we should put it into a separate function, test it, and if a better implementation arises, swap it. --- tests/unit/test_util.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/unit') diff --git a/tests/unit/test_util.py b/tests/unit/test_util.py index b35f218..949acb5 100644 --- a/tests/unit/test_util.py +++ b/tests/unit/test_util.py @@ -82,3 +82,12 @@ def test_tour_metadata(gpx_file): @pytest.mark.parametrize('mps, kph', [(1, 3.6), (10, 36)]) def test_mps_to_kph(mps, kph): assert util.mps_to_kph(mps) == pytest.approx(kph, 0.1) + + +def test_tile_url(app_request): + route_url = util.tile_url(app_request, "tile-proxy", provider="bobby") + + assert "{x}" in route_url + assert "{y}" in route_url + assert "{z}" in route_url + assert "bobby" in route_url -- cgit v1.2.3