Example #1
0
def test_get_mapper_from_registry_str_name():
    class UserMapper(Mapper):

        __type__ = dict

        id = String(required=True, read_only=True)
        name = String()

    mapper = get_mapper_from_registry('UserMapper')
    assert mapper == UserMapper
Example #2
0
def test_get_mapper_from_registry_str_name():
    class UserMapper(Mapper):

        __type__ = dict

        id = String(required=True, read_only=True)
        name = String()

    mapper = get_mapper_from_registry('UserMapper')
    assert mapper == UserMapper
Example #3
0
def test_get_mapper_from_registry_mapper_does_not_exist():

    with pytest.raises(MapperError):
        get_mapper_from_registry('OtherMapper')
Example #4
0
def test_get_mapper_from_registry_mapper_does_not_exist():

    with pytest.raises(MapperError):
        get_mapper_from_registry('OtherMapper')