Exemple #1
0
    def test_playing_with_lyrics_when_spotify_error(self,
                                                    print_mock,
                                                    gorrion_mock):
        gorrion_mock.return_value.playing_with_lyrics.side_effect = SpotifyApiError('spotify error')

        cli = CLI()
        cli.playing_with_lyrics(True, False)

        print_mock.assert_called()
Exemple #2
0
    def test_playing_with_lyrics(self, print_mock, gorrion_mock):
        gorrion_mock.return_value.playing_with_lyrics.return_value = [
            PublishedTweet('123', 'song', None),
            PublishedTweet('456', 'song-lyric1', None),
            PublishedTweet('789', 'song-lyric2', None),
        ]

        cli = CLI()
        cli.playing_with_lyrics(True, False)

        print_mock.assert_any_call('[---------------------- Song -----------------------]')
        print_mock.assert_any_call('song')
        print_mock.assert_any_call('[---------------------- Lyric ----------------------]')
        print_mock.assert_any_call('song-lyric1\n\nsong-lyric2')