示例#1
0
class YoutubeTest(TestCase):
    def setUp(self):
        super(YoutubeTest, self).setUp()
        from ytdl.youtube_api import YoutubeApi
        self.api = YoutubeApi("roosterteeth")

    def test_list_videos(self):
        videos = list(self.api.videos_for_user(limit=1))

        assert len(videos) > 0
        for v in videos:
            assert 'url' in v
            assert 'title' in v
            assert 'id' in v
            assert 'youtube.com' in v['url']

    def test_icon(self):
        url = self.api.icon()
        assert url.startswith("http://") or url.startswith("https://")

        # .jpg seems only option, but might as well randomly guess at other options
        assert url.endswith(".jpg") or url.endswith(".png") or url.endswith(".gif")

    def test_title(self):
        title = self.api.title()
        assert title == "Rooster Teeth"
示例#2
0
class YoutubeTest(TestCase):
    def setUp(self):
        super(YoutubeTest, self).setUp()
        from ytdl.youtube_api import YoutubeApi
        self.api = YoutubeApi("roosterteeth")

    def test_list_videos(self):
        videos = list(self.api.videos_for_user(limit=1))

        assert len(videos) > 0
        for v in videos:
            assert 'url' in v
            assert 'title' in v
            assert 'id' in v
            assert 'youtube.com' in v['url']

    def test_icon(self):
        url = self.api.icon()
        assert url.startswith("http://") or url.startswith("https://")

        # .jpg seems only option, but might as well randomly guess at other options
        assert url.endswith(".jpg") or url.endswith(".png") or url.endswith(
            ".gif")

    def test_title(self):
        title = self.api.title()
        assert title == "Rooster Teeth"
示例#3
0
class YoutubeTest(TestCase):
    def setUp(self):
        # type: () -> None
        super(YoutubeTest, self).setUp()
        from ytdl.youtube_api import YoutubeApi
        self.api = YoutubeApi("roosterteeth")

    def test_list_videos(self):
        # type: () -> None
        videos = list(self.api.videos_for_user(limit=1))

        assert len(videos) > 0
        for v in videos:
            assert 'url' in v
            assert 'title' in v
            assert 'id' in v
            assert 'youtube.com' in v['url']

    def test_icon(self):
        # type: () -> None
        url = self.api.icon()
        assert url.startswith("http://") or url.startswith("https://")

    def test_title(self):
        # type: () -> None
        title = self.api.title()
        assert title == "Rooster Teeth"
示例#4
0
 def setUp(self):
     super(YoutubeTest, self).setUp()
     from ytdl.youtube_api import YoutubeApi
     self.api = YoutubeApi("roosterteeth")
示例#5
0
 def setUp(self):
     super(YoutubeTest, self).setUp()
     from ytdl.youtube_api import YoutubeApi
     self.api = YoutubeApi("roosterteeth")
示例#6
0
文件: tests.py 项目: wtfmejt/webtools
 def setUp(self):
     from ytdl.youtube_api import YoutubeApi
     self.api = YoutubeApi("roosterteeth")