[DEV] unittests: compare map files with osmium in Windows, park static files, have static geofabrik .json #186
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR…
Considerations and implementations
compare map files with osmium in Windows
comparing on Windows was handled solely with
filecmp.cmp
:wahooMapsCreator/tests/test_generated_files.py
Lines 182 to 186 in 90b8657
After implementing geofabrik-only processing, the boundaries of the bounding boxes are calculated instead of taken from the static tile .json files in the repo.
The calculation via
num2deg
in geofabrik.py is not rounded and thus this is the result:wahooMapsCreator/tests/test_geofabrik.py
Lines 59 to 62 in 90b8657
using static .json files, this would be the values for
top: 36.597889
andbottom 35.46067
. Because of this difference, the split-malta.osm.pbf and split-malta-names.osm.pbf were not equal in Windows because of the comparison usingfilecmp.cmp
. I'll keep it not rounded and compare via osmium as doing in macOS some time alreadyhave static geofabrik .json
equal to the other prepared files before running
test_generated_files.py
, geofabrik.json is also handled now.park static files
Unittests run with older map, land polygons and geofabrik files. After running
test_generated_files.py
, map files and land polygons need to be downloaded again if having max. days e.g. 100 or 24. With this PR, the actual productive files are parked, then the unittests prepared, run and afterwards the parked files are copied back into productive location ;-)How to test
Pull Request Checklist