diff options
author | Matthew <coletdjnz@protonmail.com> | 2022-11-09 21:58:44 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-09 14:28:44 +0530 |
commit | 86973308cdf670956a61b3ba6d2c124576843954 (patch) | |
tree | c042d8f634b5e38352122b50035d018c89740898 /test/test_youtube_lists.py | |
parent | c61473c1d617a4d5432248815f22dcb46906acaf (diff) | |
download | hypervideo-pre-86973308cdf670956a61b3ba6d2c124576843954.tar.lz hypervideo-pre-86973308cdf670956a61b3ba6d2c124576843954.tar.xz hypervideo-pre-86973308cdf670956a61b3ba6d2c124576843954.zip |
[extractor/youtube:tab] Update tab handling for redesign (#5439)
Closes #5432, #5430, #5419
Authored by: coletdjnz, pukkandan
Diffstat (limited to 'test/test_youtube_lists.py')
-rw-r--r-- | test/test_youtube_lists.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/test_youtube_lists.py b/test/test_youtube_lists.py index c2dd0ac30..b3f323e21 100644 --- a/test/test_youtube_lists.py +++ b/test/test_youtube_lists.py @@ -10,6 +10,7 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from test.helper import FakeYDL, is_download_test from yt_dlp.extractor import YoutubeIE, YoutubeTabIE +from yt_dlp.utils import ExtractorError @is_download_test @@ -53,6 +54,18 @@ class TestYoutubeLists(unittest.TestCase): self.assertEqual(video['duration'], 10) self.assertEqual(video['uploader'], 'Philipp Hagemeister') + def test_youtube_channel_no_uploads(self): + dl = FakeYDL() + dl.params['extract_flat'] = True + ie = YoutubeTabIE(dl) + # no uploads + with self.assertRaisesRegex(ExtractorError, r'no uploads'): + ie.extract('https://www.youtube.com/channel/UC2yXPzFejc422buOIzn_0CA') + + # no uploads and no UCID given + with self.assertRaisesRegex(ExtractorError, r'no uploads'): + ie.extract('https://www.youtube.com/news') + if __name__ == '__main__': unittest.main() |