neitro commited on
Commit ·
78b647b
1
Parent(s): 0272e2f
Fixed the bug - updated tests ( https://github.com/nficano/pytube/issues/450 )
Browse files- tests/test_streams.py +9 -0
tests/test_streams.py
CHANGED
|
@@ -24,6 +24,15 @@ def test_title(cipher_signature):
|
|
| 24 |
stream = cipher_signature.streams.first()
|
| 25 |
assert stream.title == expected
|
| 26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
def test_download(cipher_signature, mocker):
|
| 29 |
mocker.patch.object(request, 'get')
|
|
|
|
| 24 |
stream = cipher_signature.streams.first()
|
| 25 |
assert stream.title == expected
|
| 26 |
|
| 27 |
+
expected = 'PSY - GANGNAM STYLE(강남스타일)'
|
| 28 |
+
stream.player_config_args = {
|
| 29 |
+
'player_response': {'videoDetails': expected}}
|
| 30 |
+
assert stream.title == expected
|
| 31 |
+
|
| 32 |
+
expected = 'Unknown YouTube Video Title'
|
| 33 |
+
stream.player_config_args = {}
|
| 34 |
+
assert stream.title == expected
|
| 35 |
+
|
| 36 |
|
| 37 |
def test_download(cipher_signature, mocker):
|
| 38 |
mocker.patch.object(request, 'get')
|