Example #1
0
def test_tweet(send_tweet):
    client = Mock()
    send_tweet.return_value = 'blah'
    poems.last_poem['#bots'] = ['foobar']
    poems.tweet(client, '#bots', 'me')
    client.msg.assert_called_with('#bots', 'blah')
Example #2
0
def test_tweet_with_failure(send_tweet):
    client = Mock()
    send_tweet.return_value = None
    poems.last_poem['#bots'] = ['foobar']
    poems.tweet(client, '#bots', 'me')
    client.msg.assert_called_with('#bots', "me, that probably did not work :(")
Example #3
0
def test_tweet_with_no_poem():
    client = Mock()
    poems.last_poem['#bots'] = None
    poems.tweet(client, '#bots', 'me')
    client.msg.assert_called_with('#bots', "me, why don't you try making one first")
Example #4
0
def test_tweet(send_tweet):
    client = Mock()
    send_tweet.return_value = 'blah'
    poems.last_poem['#bots'] = ['foobar']
    poems.tweet(client, '#bots', 'me')
    client.msg.assert_called_with('#bots', 'blah')
Example #5
0
def test_tweet_with_failure(send_tweet):
    client = Mock()
    send_tweet.return_value = None
    poems.last_poem['#bots'] = ['foobar']
    poems.tweet(client, '#bots', 'me')
    client.msg.assert_called_with('#bots', "me, that probably did not work :(")
Example #6
0
def test_tweet_with_no_poem():
    client = Mock()
    poems.last_poem['#bots'] = None
    poems.tweet(client, '#bots', 'me')
    client.msg.assert_called_with('#bots',
                                  "me, why don't you try making one first")