diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/parameters.json | 3 | ||||
| -rw-r--r-- | test/test_all_urls.py | 4 | ||||
| -rw-r--r-- | test/test_playlists.py | 49 | ||||
| -rw-r--r-- | test/test_utils.py | 5 | ||||
| -rw-r--r-- | test/test_write_info_json.py | 1 | 
5 files changed, 60 insertions, 2 deletions
diff --git a/test/parameters.json b/test/parameters.json index f042880ed..487a46d56 100644 --- a/test/parameters.json +++ b/test/parameters.json @@ -39,5 +39,6 @@      "writeinfojson": true,       "writesubtitles": false,      "allsubtitles": false, -    "listssubtitles": false +    "listssubtitles": false, +    "socket_timeout": 20  } diff --git a/test/test_all_urls.py b/test/test_all_urls.py index 1f1adb6b4..6b9764c67 100644 --- a/test/test_all_urls.py +++ b/test/test_all_urls.py @@ -106,6 +106,10 @@ class TestAllURLsMatching(unittest.TestCase):          self.assertMatch(':colbertreport', ['ComedyCentralShows'])          self.assertMatch(':cr', ['ComedyCentralShows']) +    def test_vimeo_matching(self): +        self.assertMatch('http://vimeo.com/channels/tributes', ['vimeo:channel']) +        self.assertMatch('http://vimeo.com/user7108434', ['vimeo:user']) +  if __name__ == '__main__':      unittest.main() diff --git a/test/test_playlists.py b/test/test_playlists.py index 167801ae2..87ca401e5 100644 --- a/test/test_playlists.py +++ b/test/test_playlists.py @@ -15,13 +15,18 @@ from youtube_dl.extractor import (      DailymotionPlaylistIE,      DailymotionUserIE,      VimeoChannelIE, +    VimeoUserIE, +    VimeoAlbumIE, +    VimeoGroupsIE,      UstreamChannelIE,      SoundcloudSetIE,      SoundcloudUserIE,      LivestreamIE,      NHLVideocenterIE,      BambuserChannelIE, -    BandcampAlbumIE +    BandcampAlbumIE, +    SmotriCommunityIE, +    SmotriUserIE  ) @@ -54,6 +59,30 @@ class TestPlaylists(unittest.TestCase):          self.assertEqual(result['title'], u'Vimeo Tributes')          self.assertTrue(len(result['entries']) > 24) +    def test_vimeo_user(self): +        dl = FakeYDL() +        ie = VimeoUserIE(dl) +        result = ie.extract('http://vimeo.com/nkistudio/videos') +        self.assertIsPlaylist(result) +        self.assertEqual(result['title'], u'Nki') +        self.assertTrue(len(result['entries']) > 65) + +    def test_vimeo_album(self): +        dl = FakeYDL() +        ie = VimeoAlbumIE(dl) +        result = ie.extract('http://vimeo.com/album/2632481') +        self.assertIsPlaylist(result) +        self.assertEqual(result['title'], u'Staff Favorites: November 2013') +        self.assertTrue(len(result['entries']) > 12) + +    def test_vimeo_groups(self): +        dl = FakeYDL() +        ie = VimeoGroupsIE(dl) +        result = ie.extract('http://vimeo.com/groups/rolexawards') +        self.assertIsPlaylist(result) +        self.assertEqual(result['title'], u'Rolex Awards for Enterprise') +        self.assertTrue(len(result['entries']) > 72) +      def test_ustream_channel(self):          dl = FakeYDL()          ie = UstreamChannelIE(dl) @@ -110,6 +139,24 @@ class TestPlaylists(unittest.TestCase):          self.assertIsPlaylist(result)          self.assertEqual(result['title'], u'Nightmare Night EP')          self.assertTrue(len(result['entries']) >= 4) +         +    def test_smotri_community(self): +        dl = FakeYDL() +        ie = SmotriCommunityIE(dl) +        result = ie.extract('http://smotri.com/community/video/kommuna') +        self.assertIsPlaylist(result) +        self.assertEqual(result['id'], u'kommuna') +        self.assertEqual(result['title'], u'КПРФ') +        self.assertTrue(len(result['entries']) >= 4) +         +    def test_smotri_user(self): +        dl = FakeYDL() +        ie = SmotriUserIE(dl) +        result = ie.extract('http://smotri.com/user/inspector') +        self.assertIsPlaylist(result) +        self.assertEqual(result['id'], u'inspector') +        self.assertEqual(result['title'], u'Inspector') +        self.assertTrue(len(result['entries']) >= 9)  if __name__ == '__main__':      unittest.main() diff --git a/test/test_utils.py b/test/test_utils.py index e9e590e74..0fa66beec 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -26,6 +26,7 @@ from youtube_dl.utils import (      unsmuggle_url,      shell_quote,      encodeFilename, +    str_to_int,  )  if sys.version_info < (3, 0): @@ -176,6 +177,10 @@ class TestUtil(unittest.TestCase):          args = ['ffmpeg', '-i', encodeFilename(u'ñ€ß\'.mp4')]          self.assertEqual(shell_quote(args), u"""ffmpeg -i 'ñ€ß'"'"'.mp4'""") +    def test_str_to_int(self): +        self.assertEqual(str_to_int('123,456'), 123456) +        self.assertEqual(str_to_int('123.456'), 123456) +  if __name__ == '__main__':      unittest.main() diff --git a/test/test_write_info_json.py b/test/test_write_info_json.py index d7177611b..90426a559 100644 --- a/test/test_write_info_json.py +++ b/test/test_write_info_json.py @@ -33,6 +33,7 @@ TEST_ID = 'BaW_jenozKc'  INFO_JSON_FILE = TEST_ID + '.info.json'  DESCRIPTION_FILE = TEST_ID + '.mp4.description'  EXPECTED_DESCRIPTION = u'''test chars:  "'/\ä↭𝕐 +test URL: https://github.com/rg3/youtube-dl/issues/1892  This is a test video for youtube-dl.  | 
