1
0
mirror of https://github.com/enpaul/kodak.git synced 2025-09-18 21:21:59 +00:00

Add openapi spec validation and build integartion

This commit is contained in:
2021-05-07 22:39:16 -04:00
parent 4f760fa1e5
commit 2efd5c1cbe
7 changed files with 128 additions and 6 deletions

20
tests/test_openapi.py Normal file
View File

@@ -0,0 +1,20 @@
import importlib.resources
import openapi_spec_validator
import ruamel.yaml
from imagemuck import __about__
yaml = ruamel.yaml.YAML(typ="safe") # pylint: disable=invalid-name
def test_openapi():
openapi_spec_validator.validate_spec(
yaml.load(importlib.resources.read_text("imagemuck", "openapi.yaml"))
)
def test_openapi_version():
spec = yaml.load(importlib.resources.read_text("imagemuck", "openapi.yaml"))
assert spec["info"]["version"] == __about__.__version__