# Path: tests/ex04_contact/models.py
# class Person(object):
#     name = related.StringField()
#     age = related.IntegerField(required=False)
#     address = related.ChildField(Address, required=False, repr=False)
#     education = related.SequenceField(Education, required=False, repr=False)
# 
# class Address(object):
#     street = related.StringField()
#     city = related.StringField()
#     zipcode = related.StringField()
#     street_two = related.StringField(required=False)
# 
# class Education(object):
#     school = related.StringField()
#     degree = related.ChildField(Degree, required=False)
#     field_of_study = related.StringField(required=False)
#     from_year = related.IntegerField(required=False)
#     to_year = related.IntegerField(required=False)
# 
# class Degree(Enum):
#     HIGH_SCHOOL = "High School"
#     ASSOCIATES = "Associate's"
#     BACHELORS = "Bachelor's"
#     MASTERS = "Master's"
#     PHD = "Ph.D"
#     JD = "J.D."
#     MD = "M.D."
#     DDS = "D.D.S."
#     PHARMD = "Pharm.D."


from .models import Person, Address, Education, Degree
from related import to_dict, to_yaml, from_yaml
import pytest
    person = Person(name="Bill", age=40)
    assert repr(person) == "Person(name='Bill', age=40)"

    person = Person(name="John", age="50")
    assert repr(person) == "Person(name='John', age=50)"

    d = to_dict(person)
    assert d == {'address': None,
                 'education': [],
                 'age': 50,
                 'name': 'John'}

    new_person = Person(**d)
    assert to_dict(new_person) == d
    assert new_person == person


def test_address_yaml_roundtrip():
    address = Address(street="123 Main Street", city="Springfield",
                      zipcode="12345")
    assert repr(address) == "Address(street='123 Main Street', " \
                            "city='Springfield', zipcode='12345', " \
                            "street_two=None)"

    yaml = to_yaml(address)
    new_address = from_yaml(yaml, Address)
    assert new_address == address


def test_person_with_address():

# Path: tests/ex04_contact/models.py
# class Person(object):
#     name = related.StringField()
#     age = related.IntegerField(required=False)
#     address = related.ChildField(Address, required=False, repr=False)
#     education = related.SequenceField(Education, required=False, repr=False)
# 
# class Address(object):
#     street = related.StringField()
#     city = related.StringField()
#     zipcode = related.StringField()
#     street_two = related.StringField(required=False)
# 
# class Education(object):
#     school = related.StringField()
#     degree = related.ChildField(Degree, required=False)
#     field_of_study = related.StringField(required=False)
#     from_year = related.IntegerField(required=False)
#     to_year = related.IntegerField(required=False)
# 
# class Degree(Enum):
#     HIGH_SCHOOL = "High School"
#     ASSOCIATES = "Associate's"
#     BACHELORS = "Bachelor's"
#     MASTERS = "Master's"
#     PHD = "Ph.D"
#     JD = "J.D."
#     MD = "M.D."
#     DDS = "D.D.S."
#     PHARMD = "Pharm.D."


# Path: tests/ex04_contact/test_contact.py
from .models import Person, Address, Education, Degree
from related import to_dict, to_yaml, from_yaml
import pytest

    person = Person(name="Bill", age=40)
    assert repr(person) == "Person(name='Bill', age=40)"

    person = Person(name="John", age="50")
    assert repr(person) == "Person(name='John', age=50)"

    d = to_dict(person)
    assert d == {'address': None,
                 'education': [],
                 'age': 50,
                 'name': 'John'}

    new_person = Person(**d)
    assert to_dict(new_person) == d
    assert new_person == person


def test_address_yaml_roundtrip():
    address = Address(street="123 Main Street", city="Springfield",
                      zipcode="12345")
    assert repr(address) == "Address(street='123 Main Street', " \
                            "city='Springfield', zipcode='12345', " \
                            "street_two=None)"

    yaml = to_yaml(address)
    new_address = from_yaml(yaml, Address)
    assert new_address == address


def test_person_with_address():

    address = Address(street="123 Main Street", city="Springfield",