示例#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
文件: test_mapper.py 项目: larsks/kim
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
文件: test_mapper.py 项目: larsks/kim
def test_get_mapper_from_registry_mapper_does_not_exist():

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