Esempio n. 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')
Esempio n. 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 :(")
Esempio n. 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")
Esempio n. 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')
Esempio n. 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 :(")
Esempio n. 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")