CICD/app/fizz/fizzbar/schema_test.py

26 lines
614 B
Python
Raw Normal View History

2019-05-19 16:56:56 +02:00
from pytest import fixture
from .model import Fizzbar
from .schema import FizzbarSchema
from .interface import FizzbarInterface
@fixture
def schema() -> FizzbarSchema:
return FizzbarSchema()
def test_FizzbarSchema_create(schema: FizzbarSchema):
assert schema
def test_FizzbarSchema_works(schema: FizzbarSchema):
2019-08-03 18:55:38 +02:00
params: FizzbarInterface = schema.load(
{"fizzbarId": "123", "name": "Test fizzbar", "purpose": "Test purpose"}
)
2019-05-19 16:56:56 +02:00
fizzbar = Fizzbar(**params)
assert fizzbar.fizzbar_id == 123
2019-08-03 18:55:38 +02:00
assert fizzbar.name == "Test fizzbar"
assert fizzbar.purpose == "Test purpose"