test_token_request.py 文件源码

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

项目:python-ecsclient 作者: EMCECS 项目源码 文件源码
def test_get_new_token_cache_invalid_token_path(self, mock_isdir):
        self.requests_mock.register_uri('GET', 'https://127.0.0.1:4443/login',
                                        headers={'X-SDS-AUTH-TOKEN': 'NEW-TOKEN-123'})
        mock_isdir.side_effect = lambda dir_: dir_ != '/foo/bar'
        self.token_request.cache_token = True
        self.token_request.token_path = '/foo/bar/token.txt'

        with super(testtools.TestCase, self).assertRaises(ECSClientException) as error:
            self.token_request.get_new_token()

        exception = error.exception
        self.assertEqual(exception.message, "Token directory not found")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号