test_token_request.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:python-ecsclient 作者: EMCECS 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号