コード例 #1
0
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')
コード例 #2
0
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')
コード例 #3
0
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')
コード例 #4
0
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')