e7d4e70445
Fixes #3
26 lines
595 B
Python
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"
|