def test_token_list(self): with XRDSSTTest() as app: with mock.patch('xrdsst.api.tokens_api.TokensApi.get_tokens', return_value=TokenTestData.token_list_response): token_controller = TokenController() token_controller.app = app token_controller.load_config = (lambda: self.ss_config) token_controller.list()
def test_token_list_nonresolving_url(self): urllib3.util.retry.Retry.DEFAULT = urllib3.util.retry.Retry(0) token_controller = TokenController() token_controller.load_config = (lambda: self.ss_config) self.assertRaises(urllib3.exceptions.MaxRetryError, lambda: token_controller.list())