Add basic tests framework

This commit is contained in:
2024-07-08 20:05:45 +01:00
parent 7bd1cec4bb
commit 421843757f
7 changed files with 162 additions and 1 deletions

17
tests/test_v13.py Normal file
View File

@@ -0,0 +1,17 @@
import pytest
import json
import pathlib
from pydantic_spaceapi.v13 import SpaceAPIv13Model
@pytest.fixture
def valid_v13():
file = pathlib.Path("tests/examples/valid_v13.json")
with open(file) as f:
return json.loads(f.read())
def test_working(valid_v13):
"""
Check that we can parse a valid v13 definition
"""
obj = SpaceAPIv13Model(**valid_v13)
assert isinstance(obj, SpaceAPIv13Model)