def test_handle_exception(self):
tests = [(RequestException(), [''], "7", "7"),
(ConnectTimeout(), [''], "7", "7"),
(RequestsConnectionError(), [''], "7", "7"),
(Exception("Any other exception"),
["Any other exception"],
"8 Any other exception", "8"
),
]
for exception, exp_data, exp_english, exp_code in tests:
self.check_st_exception(ConnectionError,
exp_data, exp_english, exp_code,
self.http_client._handle_exception,
func_args=(exception,))
评论列表
文章目录