def test_get_new_token_should_throw_ecsclientexception_401(self):
self.requests_mock.register_uri('GET', 'https://127.0.0.1:4443/login',
status_code=http_client.UNAUTHORIZED)
with super(testtools.TestCase, self).assertRaises(ECSClientException) as error:
self.token_request.get_new_token()
exception = error.exception
self.assertEqual(exception.http_status, http_client.UNAUTHORIZED)
评论列表
文章目录