formatting
Browse files- tests/contrib/test_playlist.py +4 -1
- tests/test_main.py +2 -2
tests/contrib/test_playlist.py
CHANGED
@@ -6,7 +6,10 @@ from pytube import Playlist
|
|
6 |
|
7 |
@mock.patch("pytube.contrib.playlist.request.get")
|
8 |
def test_title(request_get):
|
9 |
-
request_get.return_value =
|
|
|
|
|
|
|
10 |
url = "https://www.fakeurl.com/playlist?list=PLsyeobzWxl7poL9JTVyndKe62ieoN"
|
11 |
pl = Playlist(url)
|
12 |
pl_title = pl.title()
|
|
|
6 |
|
7 |
@mock.patch("pytube.contrib.playlist.request.get")
|
8 |
def test_title(request_get):
|
9 |
+
request_get.return_value = (
|
10 |
+
"<title>(149) Python Tutorial for Beginners "
|
11 |
+
"(For Absolute Beginners) - YouTube</title>"
|
12 |
+
)
|
13 |
url = "https://www.fakeurl.com/playlist?list=PLsyeobzWxl7poL9JTVyndKe62ieoN"
|
14 |
pl = Playlist(url)
|
15 |
pl_title = pl.title()
|
tests/test_main.py
CHANGED
@@ -8,8 +8,8 @@ from pytube.exceptions import VideoUnavailable
|
|
8 |
|
9 |
|
10 |
@mock.patch("pytube.__main__.YouTube")
|
11 |
-
def test_prefetch_deferred(
|
12 |
-
instance =
|
13 |
instance.prefetch_descramble.return_value = None
|
14 |
YouTube("https://www.youtube.com/watch?v=9bZkp7q19f0", True)
|
15 |
assert not instance.prefetch_descramble.called
|
|
|
8 |
|
9 |
|
10 |
@mock.patch("pytube.__main__.YouTube")
|
11 |
+
def test_prefetch_deferred(youtube):
|
12 |
+
instance = youtube.return_value
|
13 |
instance.prefetch_descramble.return_value = None
|
14 |
YouTube("https://www.youtube.com/watch?v=9bZkp7q19f0", True)
|
15 |
assert not instance.prefetch_descramble.called
|