Reworking map import to handle postgres data dumps.

This commit is contained in:
Roland 2022-03-31 07:31:15 -06:00
parent be4c3a5021
commit 5178f72b66
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
11 changed files with 194 additions and 109 deletions

View file

@ -1,16 +1,18 @@
from pathlib import Path
import pytest
from modules.map import models
@pytest.mark.parametrize('size,expected', [
(0, 0),
(-1, 0),
(17737381, 4475),
(63434267, 16006),
(87745484, 22141),
(136372996, 34411),
(116318111, 29351),
@pytest.mark.parametrize('path,size,expected', [
('file.osm.pbf', 0, 0),
('file.osm.pbf', -1, 0),
('file.osm.pbf', 17737381, 4475),
('file.osm.pbf', 63434267, 16006),
('file.osm.pbf', 87745484, 22141),
('file.osm.pbf', 136372996, 34411),
('file.osm.pbf', 116318111, 29351),
])
def test_seconds_to_import_rpi4(size, expected):
assert models.seconds_to_import(size) == expected
def test_seconds_to_import_rpi4(path, size, expected):
assert models.seconds_to_import(Path(path), size) == expected