def test_revoke_access_token(self, MockOAuthSession):
     MockOAuthSession(
     ).fetch_access_token.return_value = "{'oauth_token': 'abc', 'oauth_token_secret': 'xyz'}"
     oauth = authorization.ETradeAccessManager('xyz321', 'secret', 'abc123',
                                               'super_secret')
     self.assertTrue(oauth.revoke_access_token())
     self.assertTrue(MockOAuthSession().get.called)
示例#2
0
 def test_renew_access_token(self, MockOAuthSession):
     MockOAuthSession().fetch_access_token.return_value = (
         "{'oauth_token': 'abc', 'oauth_token_secret': 'xyz'}")
     oauth = authorization.ETradeAccessManager("xyz321", "secret", "abc123",
                                               "super_secret")
     self.assertTrue(oauth.renew_access_token())
     self.assertTrue(MockOAuthSession().get.called)