2019-05-19 16:56:56 +02:00
|
|
|
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):
|
2019-08-03 18:55:38 +02:00
|
|
|
params: WhatsitInterface = schema.load(
|
|
|
|
{"whatsitId": "123", "name": "Test whatsit", "purpose": "Test purpose"}
|
2020-01-22 17:42:52 +01:00
|
|
|
)
|
2019-05-19 16:56:56 +02:00
|
|
|
whatsit = Whatsit(**params)
|
|
|
|
|
|
|
|
assert whatsit.whatsit_id == 123
|
2019-08-03 18:55:38 +02:00
|
|
|
assert whatsit.name == "Test whatsit"
|
|
|
|
assert whatsit.purpose == "Test purpose"
|