aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/test_util.py
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2022-07-24 22:28:38 +0200
committerDaniel Schadt <kingdread@gmx.de>2022-07-24 22:28:38 +0200
commit02676f841c10b20e1a69b6936acb60dfc46da5c4 (patch)
tree6364715b101dec67cb637b103a571611c5975cf2 /tests/unit/test_util.py
parentbb8e5db3fb3a5e3a352105985a4121ee860cf763 (diff)
downloadfietsboek-02676f841c10b20e1a69b6936acb60dfc46da5c4.tar.gz
fietsboek-02676f841c10b20e1a69b6936acb60dfc46da5c4.tar.bz2
fietsboek-02676f841c10b20e1a69b6936acb60dfc46da5c4.zip
add first basic tests for synthetic tracks
Diffstat (limited to 'tests/unit/test_util.py')
-rw-r--r--tests/unit/test_util.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/unit/test_util.py b/tests/unit/test_util.py
index debf229..b35f218 100644
--- a/tests/unit/test_util.py
+++ b/tests/unit/test_util.py
@@ -66,6 +66,19 @@ def test_guess_gpx_timezone(gpx_file, offset):
assert timezone.utcoffset(None) == offset
+@pytest.mark.parametrize('gpx_file', [
+ 'Teasi_1.gpx.gz',
+ 'MyTourbook_1.gpx.gz',
+ 'Synthetic_WT2.gpx.gz',
+ 'Synthetic_BRouter_1.gpx.gz',
+])
+def test_tour_metadata(gpx_file):
+ # Here we simply make sure that we do not crash the metadata extraction
+ # function.
+ gpx_data = load_gpx_asset(gpx_file)
+ assert util.tour_metadata(gpx_data) is not None
+
+
@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)