def test_bucket_get_not_found(self):
"""Test Client.bucket_get() when bucket does not exist."""
mock_error = requests.HTTPError()
mock_error.response = mock.Mock()
mock_error.response.status_code = 404
self.mock_request.side_effect = mock_error
bucket = self.client.bucket_get('inexistent')
self.mock_request.assert_called_once_with(
method='GET',
path='/buckets/inexistent')
assert bucket is None
评论列表
文章目录