diff options
author | Daniel Schadt <kingdread@gmx.de> | 2022-07-17 20:56:38 +0200 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2022-07-17 20:56:38 +0200 |
commit | 69c9167911a8449fef20951abe924a1c4528545c (patch) | |
tree | 95b840058d8abf78e7b0fdd0331a0b86fef7b6d3 /tests/unit/test_util.py | |
parent | d8ba9371656f9bd1492b9fbe13234f216ebbd240 (diff) | |
download | fietsboek-69c9167911a8449fef20951abe924a1c4528545c.tar.gz fietsboek-69c9167911a8449fef20951abe924a1c4528545c.tar.bz2 fietsboek-69c9167911a8449fef20951abe924a1c4528545c.zip |
add tests for archive download
Diffstat (limited to 'tests/unit/test_util.py')
-rw-r--r-- | tests/unit/test_util.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/tests/unit/test_util.py b/tests/unit/test_util.py index 8f45611..13f4bfe 100644 --- a/tests/unit/test_util.py +++ b/tests/unit/test_util.py @@ -1,11 +1,10 @@ -import gzip from datetime import timedelta -from pathlib import Path import pytest import gpxpy from markupsafe import Markup +from testutils import load_gpx_asset from fietsboek import util @@ -60,10 +59,7 @@ def test_round_timedelta_to_multiple(delta, multiple, expected): ("MyTourbook_1.gpx.gz", timedelta(hours=2)), ]) def test_guess_gpx_timezone(gpx_file, offset): - asset_dir = Path(__file__).parent.parent / 'assets' - test_file = asset_dir / gpx_file - with gzip.open(test_file, 'rb') as fobj: - parsed_gpx = gpxpy.parse(fobj) + parsed_gpx = gpxpy.parse(load_gpx_asset(gpx_file)) timezone = util.guess_gpx_timezone(parsed_gpx) # Here we hope (and assume) that utcoffset is ignored. This is true for # datetime.timezone objects, but may not be for other datetime.tzinfo |