diff options
author | Daniel Schadt <kingdread@gmx.de> | 2022-07-24 22:28:38 +0200 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2022-07-24 22:28:38 +0200 |
commit | 02676f841c10b20e1a69b6936acb60dfc46da5c4 (patch) | |
tree | 6364715b101dec67cb637b103a571611c5975cf2 /tests | |
parent | bb8e5db3fb3a5e3a352105985a4121ee860cf763 (diff) | |
download | fietsboek-02676f841c10b20e1a69b6936acb60dfc46da5c4.tar.gz fietsboek-02676f841c10b20e1a69b6936acb60dfc46da5c4.tar.bz2 fietsboek-02676f841c10b20e1a69b6936acb60dfc46da5c4.zip |
add first basic tests for synthetic tracks
Diffstat (limited to 'tests')
-rw-r--r-- | tests/assets/Synthetic_BRouter_1.gpx.gz | bin | 0 -> 697 bytes | |||
-rw-r--r-- | tests/assets/Synthetic_WT2.gpx.gz | bin | 0 -> 18941 bytes | |||
-rw-r--r-- | tests/unit/test_util.py | 13 |
3 files changed, 13 insertions, 0 deletions
diff --git a/tests/assets/Synthetic_BRouter_1.gpx.gz b/tests/assets/Synthetic_BRouter_1.gpx.gz Binary files differnew file mode 100644 index 0000000..e380fc7 --- /dev/null +++ b/tests/assets/Synthetic_BRouter_1.gpx.gz diff --git a/tests/assets/Synthetic_WT2.gpx.gz b/tests/assets/Synthetic_WT2.gpx.gz Binary files differnew file mode 100644 index 0000000..eb74472 --- /dev/null +++ b/tests/assets/Synthetic_WT2.gpx.gz 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) |