Initial commit

This commit is contained in:
phil 2024-10-23 16:19:51 +02:00
commit f4cf78603a
25 changed files with 2895 additions and 0 deletions

0
tests/__init__.py Normal file
View file

16
tests/basic.py Normal file
View file

@ -0,0 +1,16 @@
from fastapi.testclient import TestClient
from treetrail.application import app
client = TestClient(app)
def test_read_main():
with TestClient(app) as client:
response = client.get("/treetrail/v1/bootstrap")
assert response.status_code == 200
json = response.json()
assert set(json) == {'client', 'server', 'user', 'map', 'baseMapStyles', 'app'}
assert json['user'] is None
assert set(json['map']) == {'bearing', 'lat', 'background', 'lng', 'pitch', 'zoom'}
assert set(json['baseMapStyles']) == {'external', 'embedded'}