def test_get_pafy_playlist():
    from youtube_thumbnail.api import get_pafy

    with mock.patch('pafy.get_playlist',
                    return_value={'items': [{
                        'pafy': ''
                    }]}) as pafy:
        get_pafy('https://youtube.com/videoseries')
        assert pafy.called_once_with('https://youtube.com/videoseries')
def test_get_pafy_playlist():
    from youtube_thumbnail.api import get_pafy

    with mock.patch('pafy.get_playlist', return_value={'items': [{'pafy': ''}]}) as pafy:
        get_pafy('https://youtube.com/videoseries')
        assert pafy.called_once_with('https://youtube.com/videoseries')
def test_get_pafy():
    from youtube_thumbnail.api import get_pafy

    with mock.patch('pafy.new') as pafy:
        get_pafy('https://youtube.com/video')
        assert pafy.called_once_with('https://youtube.com/video')
def test_get_pafy():
    from youtube_thumbnail.api import get_pafy

    with mock.patch('pafy.new') as pafy:
        get_pafy('https://youtube.com/video')
        assert pafy.called_once_with('https://youtube.com/video')