def test_not_found(self): commands = TwitterCommands("api") result = commands.resolve("command not found") assert (commands.not_found, {}) == result assert u"Command not found" == commands.not_found()
def test_resolve_direct_message_command(self): commands = TwitterCommands("api") result = commands.resolve(u"dm @igorsobreira hello") params = {'screen_name': 'igorsobreira', 'text': 'hello'} assert (commands.send_direct_message, params) == result
def test_resolve_tweet_comamnd(self): commands = TwitterCommands("api") result = commands.resolve(u"tweet this is a tweet") assert (commands.update_status, {'tweet': 'this is a tweet'}) == result
def test_resolve_timeline_command_paginated(self): commands = TwitterCommands("api") result = commands.resolve(u"timeline 2") assert (commands.home_timeline, {'page': '2'}) == result
def test_ignore_extra_spaces(self): commands = TwitterCommands("api") result = commands.resolve(u" timeline ") assert (commands.home_timeline, {}) == result
def test_resolve_timeline_command(self): commands = TwitterCommands("api") result = commands.resolve(u"timeline") assert (commands.home_timeline, {}) == result