aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-08-15 13:42:23 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-08-17 04:29:56 +0530
commit8f18aca8717bb0dd49054555af8d386e5eda3a88 (patch)
treed152c00de20766b03d001f60d4bffc45a3e5ea16 /test
parent3ad56b42360bd73c1c9c68dbd1d65d1ca492d676 (diff)
downloadhypervideo-pre-8f18aca8717bb0dd49054555af8d386e5eda3a88.tar.lz
hypervideo-pre-8f18aca8717bb0dd49054555af8d386e5eda3a88.tar.xz
hypervideo-pre-8f18aca8717bb0dd49054555af8d386e5eda3a88.zip
Let `--match-filter` reject entries early
Makes redundant: `--match-title`, `--reject-title`, `--min-views`, `--max-views`
Diffstat (limited to 'test')
-rw-r--r--test/test_utils.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/test_utils.py b/test/test_utils.py
index aef59e491..dedc598f7 100644
--- a/test/test_utils.py
+++ b/test/test_utils.py
@@ -1285,9 +1285,15 @@ ffmpeg version 2.4.4 Copyright (c) 2000-2014 the FFmpeg ...'''), '2.4.4')
self.assertTrue(match_str(r'x="foo \& bar" & x^=foo', {'x': 'foo & bar'}))
# Example from docs
- self.assertTrue(
- r'!is_live & like_count>?100 & description~=\'(?i)\bcats \& dogs\b\'',
- {'description': 'Raining Cats & Dogs'})
+ self.assertTrue(match_str(
+ r"!is_live & like_count>?100 & description~='(?i)\bcats \& dogs\b'",
+ {'description': 'Raining Cats & Dogs'}))
+
+ # Incomplete
+ self.assertFalse(match_str('id!=foo', {'id': 'foo'}, True))
+ self.assertTrue(match_str('x', {'id': 'foo'}, True))
+ self.assertTrue(match_str('!x', {'id': 'foo'}, True))
+ self.assertFalse(match_str('x', {'id': 'foo'}, False))
def test_parse_dfxp_time_expr(self):
self.assertEqual(parse_dfxp_time_expr(None), None)