1
0
mirror of https://github.com/enpaul/kodak.git synced 2024-11-14 18:46:50 +00:00
kodak/tests/test_openapi.py

21 lines
508 B
Python
Raw Normal View History

import importlib.resources
import openapi_spec_validator
import ruamel.yaml
2021-10-28 23:03:09 +00:00
from fresnel_lens import __about__
yaml = ruamel.yaml.YAML(typ="safe") # pylint: disable=invalid-name
def test_openapi():
openapi_spec_validator.validate_spec(
2021-10-28 23:03:09 +00:00
yaml.load(importlib.resources.read_text("fresnel_lens", "openapi.yaml"))
)
def test_openapi_version():
2021-10-28 23:03:09 +00:00
spec = yaml.load(importlib.resources.read_text("fresnel_lens", "openapi.yaml"))
assert spec["info"]["version"] == __about__.__version__