コード例 #1
0
ファイル: test_poems.py プロジェクト: carriercomm/helga
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')
コード例 #2
0
ファイル: test_poems.py プロジェクト: carriercomm/helga
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 :(")
コード例 #3
0
ファイル: test_poems.py プロジェクト: carriercomm/helga
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")
コード例 #4
0
ファイル: test_poems.py プロジェクト: michaelorr/helga
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')
コード例 #5
0
ファイル: test_poems.py プロジェクト: michaelorr/helga
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 :(")
コード例 #6
0
ファイル: test_poems.py プロジェクト: michaelorr/helga
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")