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
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
def test_tweet_command_ignores_empty_tweets(self): commands = TwitterCommands("api") result = commands.update_status(" ") assert u"Empty tweet" == result