def test_post_timeout():
with mock.patch("umapi_client.connection.requests.Session.post") as mock_post:
mock_post.side_effect = requests.Timeout
conn = Connection(**dict(mock_connection_params, retry_max_attempts=2))
pytest.raises(UnavailableError, conn.make_call, "", [3, 5])
assert mock_post.call_count == 2
test_connections.py 文件源码
python
阅读 34
收藏 0
点赞 0
评论 0
评论列表
文章目录