You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
1.2 KiB

  1. #!/usr/bin/env python
  2. import sys
  3. import unittest
  4. # Allow direct execution
  5. import os
  6. sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
  7. from youtube_dl.InfoExtractors import JustinTVIE
  8. class TestJustinTVMatching(unittest.TestCase):
  9. def test_justin_tv_channelid_matching(self):
  10. self.assertTrue(JustinTVIE.suitable(u"justin.tv/vanillatv"))
  11. self.assertTrue(JustinTVIE.suitable(u"twitch.tv/vanillatv"))
  12. self.assertTrue(JustinTVIE.suitable(u"www.justin.tv/vanillatv"))
  13. self.assertTrue(JustinTVIE.suitable(u"www.twitch.tv/vanillatv"))
  14. self.assertTrue(JustinTVIE.suitable(u"http://www.justin.tv/vanillatv"))
  15. self.assertTrue(JustinTVIE.suitable(u"http://www.twitch.tv/vanillatv"))
  16. self.assertTrue(JustinTVIE.suitable(u"http://www.justin.tv/vanillatv/"))
  17. self.assertTrue(JustinTVIE.suitable(u"http://www.twitch.tv/vanillatv/"))
  18. def test_justintv_videoid_matching(self):
  19. self.assertTrue(JustinTVIE.suitable(u"http://www.twitch.tv/vanillatv/b/328087483"))
  20. def test_justin_tv_chapterid_matching(self):
  21. self.assertTrue(JustinTVIE.suitable(u"http://www.twitch.tv/tsm_theoddone/c/2349361"))
  22. if __name__ == '__main__':
  23. unittest.main()