예제 #1
0
    def test_authenticate(self):
        handler = self.mocker.mock()
        handler.get_authorization_url()
        self.mocker.result("http://twitter.com/authorize")

        tweepy = self.mocker.replace("tweepy")
        tweepy.OAuthHandler(mocker.ARGS)
        self.mocker.result(handler)

        self.mocker.replay()
        
        account = TwitterAccount("[email protected]/Adium123")
        redirect_url = account.authenticate()
        
        self.mocker.verify()

        assert "http://twitter.com/authorize" == redirect_url
        assert account.authenticating
        assert not account.verified