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]
评论列表
文章目录