mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
More SpatiaLite details on /-/versions, closes #1607
This commit is contained in:
parent
1b2f0ab6bb
commit
458f03ad3a
3 changed files with 65 additions and 0 deletions
21
tests/test_spatialite.py
Normal file
21
tests/test_spatialite.py
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
from datasette.app import Datasette
|
||||
from datasette.utils import find_spatialite, SpatialiteNotFound, SPATIALITE_FUNCTIONS
|
||||
import pytest
|
||||
|
||||
|
||||
def has_spatialite():
|
||||
try:
|
||||
find_spatialite()
|
||||
return True
|
||||
except SpatialiteNotFound:
|
||||
return False
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.skipif(not has_spatialite(), reason="Requires SpatiaLite")
|
||||
async def test_spatialite_version_info():
|
||||
ds = Datasette(sqlite_extensions=["spatialite"])
|
||||
response = await ds.client.get("/-/versions.json")
|
||||
assert response.status_code == 200
|
||||
spatialite = response.json()["sqlite"]["extensions"]["spatialite"]
|
||||
assert set(SPATIALITE_FUNCTIONS) == set(spatialite)
|
||||
Loading…
Add table
Add a link
Reference in a new issue