mirror of
https://github.com/hyperknot/openfreemap.git
synced 2026-05-21 22:12:15 +00:00
set version
This commit is contained in:
@@ -15,14 +15,18 @@ def get_versions_for_area(area: str) -> list:
|
||||
|
||||
|
||||
def check_host_version(domain, host_ip, area, version):
|
||||
# check versioned TileJSON
|
||||
url = f'https://{domain}/{area}/{version}'
|
||||
tilejson_str = pycurl_get(url, domain, host_ip)
|
||||
tilejson = json.loads(tilejson_str)
|
||||
tiles_url = tilejson['tiles'][0]
|
||||
version_in_tilejson = tiles_url.split('/')[4]
|
||||
assert version_in_tilejson == version
|
||||
|
||||
# check actual vector tile
|
||||
url = f'https://{domain}/{area}/{version}/14/8529/5975.pbf'
|
||||
assert pycurl_status(url, domain, host_ip) == 200
|
||||
|
||||
# check style
|
||||
url = f'https://{domain}/styles/bright'
|
||||
assert pycurl_status(url, domain, host_ip) == 200
|
||||
|
||||
|
||||
def check_host_latest(domain, host_ip, area, version):
|
||||
# check TileJSON first
|
||||
@@ -42,6 +46,9 @@ def check_host_latest(domain, host_ip, area, version):
|
||||
assert pycurl_status(url, domain, host_ip) == 200
|
||||
|
||||
|
||||
# pycurl
|
||||
|
||||
|
||||
def pycurl_status(url, domain, host_ip):
|
||||
"""
|
||||
Uses pycurl to make a HTTPS HEAD request using custom resolving,
|
||||
|
||||
Reference in New Issue
Block a user