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")
评论列表
文章目录