CICD/app/other_api/doodad/schema_test.py
2020-01-22 10:42:52 -06:00

26 lines
595 B
Python

from pytest import fixture
from .model import Doodad
from .schema import DoodadSchema
from .interface import DoodadInterface
@fixture
def schema() -> DoodadSchema:
return DoodadSchema()
def test_DoodadSchema_create(schema: DoodadSchema):
assert schema
def test_DoodadSchema_works(schema: DoodadSchema):
params: DoodadInterface = schema.load(
{"doodadId": "123", "name": "Test doodad", "purpose": "Test purpose"}
)
doodad = Doodad(**params)
assert doodad.doodad_id == 123
assert doodad.name == "Test doodad"
assert doodad.purpose == "Test purpose"