test_client.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:kripodb 作者: 3D-e-Chem 项目源码 文件源码
def test_pharmacophores_somenotfound_incomplete(base_url, client, example1_phar):
    with requests_mock.mock() as m:
        m.get(base_url + '/fragments/3j7u_NDP_frag24.phar', text=example1_phar)
        notfound = {
            'detail': "Fragment with identifier '3j7u_NDP_frag23' not found",
            'identifier': '3j7u_NDP_frag23',
            'status': 404,
            'title': 'Not Found',
            'type': 'about:blank'
        }
        m.get(base_url + '/fragments/3j7u_NDP_frag23.phar', status_code=404, json=notfound, headers={'Content-Type': 'application/problem+json'})

        with pytest.raises(IncompletePharmacophores) as excinfo:
            client.pharmacophores(['3j7u_NDP_frag24', '3j7u_NDP_frag23'])

        assert excinfo.value.absent_identifiers == ['3j7u_NDP_frag23']
        assert excinfo.value.pharmacophores == [example1_phar, None]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号