CICD/app/other_api/whatsit/schema_test.py
2019-05-19 10:56:56 -04:00

28 lines
635 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'