Пример #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
Пример #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
Пример #3
0
def test_get_mapper_from_registry_mapper_does_not_exist():

    with pytest.raises(MapperError):
        get_mapper_from_registry('OtherMapper')
Пример #4
0
def test_get_mapper_from_registry_mapper_does_not_exist():

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