Alpha stage commit
This commit is contained in:
22
tests/test_source_updates.py
Normal file
22
tests/test_source_updates.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from app.models import Source
|
||||
from app.source_updates import _recover_missing_managed_cache_url
|
||||
|
||||
|
||||
def test_missing_managed_cache_source_recovers_seed_url_for_online_update():
|
||||
source = Source(
|
||||
id=3,
|
||||
name="Geofabrik Berlin OSM PBF",
|
||||
kind="osm_pbf",
|
||||
url="data/sources/source_3/1782478365.osm.pbf",
|
||||
country="DE",
|
||||
)
|
||||
|
||||
recovery = _recover_missing_managed_cache_url(source)
|
||||
|
||||
assert recovery == {
|
||||
"previous_url": "data/sources/source_3/1782478365.osm.pbf",
|
||||
"url": "https://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf",
|
||||
}
|
||||
assert source.url == "https://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf"
|
||||
Reference in New Issue
Block a user