def test_token_validation_500(self, mock_get_existing_token):
self.requests_mock.register_uri('GET', 'https://127.0.0.1:4443/user/whoami',
status_code=http_client.INTERNAL_SERVER_ERROR)
mock_get_existing_token.return_value = 'EXISTING-TOKEN-123'
with super(testtools.TestCase, self).assertRaises(ECSClientException) as error:
self.token_request.get_token()
exception = error.exception
self.assertEqual(exception.message, "Token validation error (Code: 500)")
self.assertEqual(exception.http_status, http_client.INTERNAL_SERVER_ERROR)
评论列表
文章目录