diff --git a/test_filter_logging.py b/test_filter_logging.py index ddd020d..a09f666 100644 --- a/test_filter_logging.py +++ b/test_filter_logging.py @@ -9,6 +9,7 @@ sys.path.insert(0, os.path.dirname(__file__)) from douyin.fudai.douyin_fudai_core import should_skip_fudai_by_config + # 创建一个模拟的 analyser 对象 class MockAnalyser: def _log_kv(self, category, message, **kwargs): @@ -16,6 +17,7 @@ class MockAnalyser: for key, value in kwargs.items(): print(f" {key}: {value}") + # 测试筛选逻辑 analyser = MockAnalyser() @@ -23,13 +25,13 @@ analyser = MockAnalyser() # 格式为 (prize_value_yuan, participants, copies, content, button_text, countdown_tuple, ...) detail = ( 75.0, # prize_value_yuan - 10, # participants - 1, # copies - "", # content + 10, # participants + 1, # copies + "", # content "一键发表评论", # button_text (time.time() + 120, time.time() + 120), # countdown (start, end) ) result, reason = should_skip_fudai_by_config(analyser=analyser, detail=detail) -print(f"\n筛选结果: {'跳过' if result else '参与'}, 原因: {reason}") \ No newline at end of file +print(f"\n筛选结果: {'跳过' if result else '参与'}, 原因: {reason}")