aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_YoutubeDL.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-06-11 19:13:22 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-06-11 19:13:22 +0530
commit187986a857993411fd31c4e017ea4fccccf343fa (patch)
treef9b14d1a47e3b9ed4fe4dcbf2a1e8a7809bf7ad6 /test/test_YoutubeDL.py
parent4ba001080fc39c121186f7a799dbe0c87b1906a8 (diff)
downloadhypervideo-pre-187986a857993411fd31c4e017ea4fccccf343fa.tar.lz
hypervideo-pre-187986a857993411fd31c4e017ea4fccccf343fa.tar.xz
hypervideo-pre-187986a857993411fd31c4e017ea4fccccf343fa.zip
Better error handling of syntax errors in `-f`
Diffstat (limited to 'test/test_YoutubeDL.py')
-rw-r--r--test/test_YoutubeDL.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/test/test_YoutubeDL.py b/test/test_YoutubeDL.py
index 0ffcaed91..8d796bcdd 100644
--- a/test/test_YoutubeDL.py
+++ b/test/test_YoutubeDL.py
@@ -461,14 +461,13 @@ class TestFormatSelection(unittest.TestCase):
def test_invalid_format_specs(self):
def assert_syntax_error(format_spec):
- ydl = YDL({'format': format_spec})
- info_dict = _make_result([{'format_id': 'foo', 'url': TEST_URL}])
- self.assertRaises(SyntaxError, ydl.process_ie_result, info_dict)
+ self.assertRaises(SyntaxError, YDL, {'format': format_spec})
assert_syntax_error('bestvideo,,best')
assert_syntax_error('+bestaudio')
assert_syntax_error('bestvideo+')
assert_syntax_error('/')
+ assert_syntax_error('[720<height]')
def test_format_filtering(self):
formats = [