Exemplo n.º 1
0
    def test_tweet_command_validate_length(self):
        api = self.mocker.mock()
        
        self.mocker.replay()

        commands = TwitterCommands(api)
        result = commands.update_status(u"o"*141)
        
        self.mocker.verify()
        assert u"Tweet too long, 141 characters. Must be up to 140." == result
Exemplo n.º 2
0
    def test_tweet_command(self):
        api = self.mocker.mock()
        api.update_status(u"this is a tweet to test the api")
        
        self.mocker.replay()

        commands = TwitterCommands(api)
        result = commands.update_status(u"this is a tweet to test the api")
        
        self.mocker.verify()
        assert u"Tweet sent" == result
Exemplo n.º 3
0
 def test_tweet_command_ignores_empty_tweets(self):
     commands = TwitterCommands("api")
     result = commands.update_status("  ")
     
     assert u"Empty tweet" == result