CICD/app/other_api/whatsit/schema_test.py
2019-08-03 12:55:38 -04:00

26 lines
619 B
Python

from pytest import fixture
from .model import Whatsit
from .schema import WhatsitSchema
from .interface import WhatsitInterface
@fixture
def schema() -> WhatsitSchema:
return WhatsitSchema()
def test_WhatsitSchema_create(schema: WhatsitSchema):
assert schema
def test_WhatsitSchema_works(schema: WhatsitSchema):
params: WhatsitInterface = schema.load(
{"whatsitId": "123", "name": "Test whatsit", "purpose": "Test purpose"}
).data
whatsit = Whatsit(**params)
assert whatsit.whatsit_id == 123
assert whatsit.name == "Test whatsit"
assert whatsit.purpose == "Test purpose"