Ejemplo n.º 1
0
    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()
Ejemplo n.º 2
0
 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 
Ejemplo n.º 3
0
 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
Ejemplo n.º 4
0
 def test_resolve_timeline_command_paginated(self):
     commands = TwitterCommands("api")
     result = commands.resolve(u"timeline 2")
     
     assert (commands.home_timeline, {'page': '2'}) == result
Ejemplo n.º 5
0
    def test_ignore_extra_spaces(self):
        commands = TwitterCommands("api")
        result = commands.resolve(u"  timeline   ")

        assert (commands.home_timeline, {}) == result
Ejemplo n.º 6
0
 def test_resolve_timeline_command(self):
     commands = TwitterCommands("api")
     result = commands.resolve(u"timeline")
     
     assert (commands.home_timeline, {}) == result