Skip to content

Commit 5ad69d3

Browse files
committed
[test_youtube_misc] Move YoutubeIE.extract_id test into separate module
1 parent 3229030 commit 5ad69d3

File tree

2 files changed

+26
-9
lines changed

2 files changed

+26
-9
lines changed

test/test_all_urls.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,6 @@ def test_youtube_feeds(self):
7070
# self.assertMatch('http://www.youtube.com/results?search_query=making+mustard', ['youtube:search_url'])
7171
# self.assertMatch('https://www.youtube.com/results?baz=bar&search_query=youtube-dl+test+video&filters=video&lclk=video', ['youtube:search_url'])
7272

73-
def test_youtube_extract(self):
74-
assertExtractId = lambda url, id: self.assertEqual(YoutubeIE.extract_id(url), id)
75-
assertExtractId('http://www.youtube.com/watch?&v=BaW_jenozKc', 'BaW_jenozKc')
76-
assertExtractId('https://www.youtube.com/watch?&v=BaW_jenozKc', 'BaW_jenozKc')
77-
assertExtractId('https://www.youtube.com/watch?feature=player_embedded&v=BaW_jenozKc', 'BaW_jenozKc')
78-
assertExtractId('https://www.youtube.com/watch_popup?v=BaW_jenozKc', 'BaW_jenozKc')
79-
assertExtractId('http://www.youtube.com/watch?v=BaW_jenozKcsharePLED17F32AD9753930', 'BaW_jenozKc')
80-
assertExtractId('BaW_jenozKc', 'BaW_jenozKc')
81-
8273
def test_facebook_matching(self):
8374
self.assertTrue(FacebookIE.suitable('https://www.facebook.com/Shiniknoh#!/photo.php?v=10153317450565268'))
8475
self.assertTrue(FacebookIE.suitable('https://www.facebook.com/cindyweather?fref=ts#!/photo.php?v=10152183998945793'))

test/test_youtube_misc.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env python
2+
from __future__ import unicode_literals
3+
4+
# Allow direct execution
5+
import os
6+
import sys
7+
import unittest
8+
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
9+
10+
11+
from youtube_dl.extractor import YoutubeIE
12+
13+
14+
class TestYoutubeMisc(unittest.TestCase):
15+
def test_youtube_extract(self):
16+
assertExtractId = lambda url, id: self.assertEqual(YoutubeIE.extract_id(url), id)
17+
assertExtractId('http://www.youtube.com/watch?&v=BaW_jenozKc', 'BaW_jenozKc')
18+
assertExtractId('https://www.youtube.com/watch?&v=BaW_jenozKc', 'BaW_jenozKc')
19+
assertExtractId('https://www.youtube.com/watch?feature=player_embedded&v=BaW_jenozKc', 'BaW_jenozKc')
20+
assertExtractId('https://www.youtube.com/watch_popup?v=BaW_jenozKc', 'BaW_jenozKc')
21+
assertExtractId('http://www.youtube.com/watch?v=BaW_jenozKcsharePLED17F32AD9753930', 'BaW_jenozKc')
22+
assertExtractId('BaW_jenozKc', 'BaW_jenozKc')
23+
24+
25+
if __name__ == '__main__':
26+
unittest.main()

0 commit comments

Comments
 (0)