Пример #1
0
 def test_api_get_channel_videos(self):
     html_code = read_in_file('tests/htmls/channel_about_page.txt')
     html_code2 = read_in_file('tests/htmls/channel_videos_page.txt')
     channel = YoutubeApi(FakeFetcher(html_code, html_code2)).get_channel('LanaDelReyVEVO')
     signature = VideoSignature('JRWox-i6aAk', 'Lana Del Rey - Blue Jeans',
                                 'LanaDelReyVEVO', '149473022', '4:21')
     self.assertTrue(signature in channel.get_uploaded_videos())
     for video in channel.get_uploaded_videos():
         self.assertIsInstance(video, VideoSignature)
Пример #2
0
    def test_real_get_channel_videos(self):
        channel = YoutubeApi().get_channel('LanaDelReyVEVO')
        blue_jeans = [x for x in channel.get_uploaded_videos() if x.get_id() == 'JRWox-i6aAk']
        self.assertEqual(len(blue_jeans), 1)
        blue_jeans = blue_jeans[0]
        self.assertEqual(blue_jeans.get_id(), 'JRWox-i6aAk')
        self.assertEqual(blue_jeans.get_title(), 'Lana Del Rey - Blue Jeans')
        self.assertEqual(blue_jeans.get_author(), 'LanaDelReyVEVO')
        self.assertEqual(blue_jeans.get_length(), '4:21')

        for video in channel.get_uploaded_videos():
            self.assertIsInstance(video, VideoSignature)