Add test for schema validation
This commit is contained in:
parent
9cc8b0fa40
commit
43650e2301
2 changed files with 81 additions and 54 deletions
17
server_test.py
Normal file
17
server_test.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
import requests
|
||||
from jsonschema import validate
|
||||
|
||||
|
||||
import server
|
||||
|
||||
|
||||
def test_schema_compliance():
|
||||
resp = requests.get(
|
||||
"https://raw.githubusercontent.com/SpaceApi/schema/refs/heads/master/13.json"
|
||||
)
|
||||
resp.raise_for_status()
|
||||
schema = resp.json()
|
||||
|
||||
spaceapi = server.state()
|
||||
|
||||
validate(instance=spaceapi, schema=schema)
|
Loading…
Add table
Add a link
Reference in a new issue