diff options
author | Max Teegen <870074+max-te@users.noreply.github.com> | 2021-06-13 16:25:19 +0200 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-08-05 03:37:20 +0530 |
commit | 77b87f0519719c4264f400f5627da86c12f48bca (patch) | |
tree | 798db56b443b927f806073f1da56b7dd06ac66b6 /test/test_utils.py | |
parent | 678da2f21b9a9ff0329bc64469f5312f4ef9d921 (diff) | |
download | hypervideo-pre-77b87f0519719c4264f400f5627da86c12f48bca.tar.lz hypervideo-pre-77b87f0519719c4264f400f5627da86c12f48bca.tar.xz hypervideo-pre-77b87f0519719c4264f400f5627da86c12f48bca.zip |
Add all format filtering operators also to `--match-filter`
PR: https://github.com/ytdl-org/youtube-dl/pull/27361
Authored by: max-te
Diffstat (limited to 'test/test_utils.py')
-rw-r--r-- | test/test_utils.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/test/test_utils.py b/test/test_utils.py index f73e7b204..5ac5dedc9 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -1207,7 +1207,6 @@ ffmpeg version 2.4.4 Copyright (c) 2000-2014 the FFmpeg ...'''), '2.4.4') '9999 51') def test_match_str(self): - self.assertRaises(ValueError, match_str, 'xy>foobar', {}) self.assertFalse(match_str('xy', {'x': 1200})) self.assertTrue(match_str('!xy', {'x': 1200})) self.assertTrue(match_str('x', {'x': 1200})) @@ -1224,6 +1223,17 @@ ffmpeg version 2.4.4 Copyright (c) 2000-2014 the FFmpeg ...'''), '2.4.4') self.assertTrue(match_str('y=foobar42', {'y': 'foobar42'})) self.assertFalse(match_str('y!=foobar42', {'y': 'foobar42'})) self.assertTrue(match_str('y!=foobar2', {'y': 'foobar42'})) + self.assertTrue(match_str('y^=foo', {'y': 'foobar42'})) + self.assertFalse(match_str('y!^=foo', {'y': 'foobar42'})) + self.assertFalse(match_str('y^=bar', {'y': 'foobar42'})) + self.assertTrue(match_str('y!^=bar', {'y': 'foobar42'})) + self.assertRaises(ValueError, match_str, 'x^=42', {'x': 42}) + self.assertTrue(match_str('y*=bar', {'y': 'foobar42'})) + self.assertFalse(match_str('y!*=bar', {'y': 'foobar42'})) + self.assertFalse(match_str('y*=baz', {'y': 'foobar42'})) + self.assertTrue(match_str('y!*=baz', {'y': 'foobar42'})) + self.assertTrue(match_str('y$=42', {'y': 'foobar42'})) + self.assertFalse(match_str('y$=43', {'y': 'foobar42'})) self.assertFalse(match_str( 'like_count > 100 & dislike_count <? 50 & description', {'like_count': 90, 'description': 'foo'})) |