CICD/app/fizz/fizzbaz/schema_test.py

26 lines
619 B
Python
Raw Normal View History

2019-05-19 16:56:56 +02:00
from pytest import fixture
from .model import Fizzbaz
from .schema import FizzbazSchema
from .interface import FizzbazInterface
@fixture
def schema() -> FizzbazSchema:
return FizzbazSchema()
def test_FizzbazSchema_create(schema: FizzbazSchema):
assert schema
def test_FizzbazSchema_works(schema: FizzbazSchema):
2019-08-03 18:55:38 +02:00
params: FizzbazInterface = schema.load(
{"fizzbazId": "123", "name": "Test fizzbaz", "purpose": "Test purpose"}
).data
2019-05-19 16:56:56 +02:00
fizzbaz = Fizzbaz(**params)
assert fizzbaz.fizzbaz_id == 123
2019-08-03 18:55:38 +02:00
assert fizzbaz.name == "Test fizzbaz"
assert fizzbaz.purpose == "Test purpose"