2021-05-08 02:39:16 +00:00
|
|
|
import importlib.resources
|
|
|
|
|
|
|
|
import openapi_spec_validator
|
|
|
|
import ruamel.yaml
|
|
|
|
|
2021-10-29 03:17:00 +00:00
|
|
|
from kodak import __about__
|
2021-05-08 02:39:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
yaml = ruamel.yaml.YAML(typ="safe") # pylint: disable=invalid-name
|
|
|
|
|
|
|
|
|
|
|
|
def test_openapi():
|
|
|
|
openapi_spec_validator.validate_spec(
|
2021-10-29 03:17:00 +00:00
|
|
|
yaml.load(importlib.resources.read_text("kodak", "openapi.yaml"))
|
2021-05-08 02:39:16 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
def test_openapi_version():
|
2021-10-29 03:17:00 +00:00
|
|
|
spec = yaml.load(importlib.resources.read_text("kodak", "openapi.yaml"))
|
2021-05-08 02:39:16 +00:00
|
|
|
assert spec["info"]["version"] == __about__.__version__
|