Skip to content

Commit

Permalink
fix test_playlist.test_title
Browse files Browse the repository at this point in the history
  • Loading branch information
hbmartin committed Jan 25, 2020
1 parent 2a1fbc4 commit 86b6955
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tests/contrib/test_playlist.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# -*- coding: utf-8 -*-
from unittest import mock

from pytube import Playlist


def test_title():
list_key = "PLsyeobzWxl7poL9JTVyndKe62ieoN-MZ3"
url = "https://www.youtube.com/playlist?list=" + list_key
@mock.patch("pytube.contrib.playlist.request.get")
def test_title(request_get):
request_get.return_value = (
"<title>(149) Python Tutorial for Beginners "
"(For Absolute Beginners) - YouTube</title>"
)
url = "https://www.fakeurl.com/playlist?list=PLsyeobzWxl7poL9JTVyndKe62ieoN"
pl = Playlist(url)
pl_title = pl.title()
assert pl_title == "Python Tutorial for Beginners"
assert pl_title == "(149) Python Tutorial for Beginners (For Absolute Beginners)"

0 comments on commit 86b6955

Please sign in to comment.