From b16ba547ab0cef98a31ec88e2b165d718264826a Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Wed, 11 Dec 2024 20:21:50 -0800 Subject: [PATCH] test: Add assertion for line count in test_ai_comment_pattern --- tests/basic/test_watch.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/basic/test_watch.py b/tests/basic/test_watch.py index 9d2599104..f4d8de012 100644 --- a/tests/basic/test_watch.py +++ b/tests/basic/test_watch.py @@ -45,10 +45,14 @@ def test_ai_comment_pattern(): # Test watch_question.js fixture question_js_path = fixtures_dir / "watch_question.js" - question_js_lines, question_js_comments, question_js_has_bang = watcher.get_ai_comments(str(question_js_path)) + question_js_lines, question_js_comments, question_js_has_bang = watcher.get_ai_comments( + str(question_js_path) + ) question_js_expected = 5 + assert len(question_js_lines) == question_js_expected, ( + f"Expected {question_js_expected} AI comments in watch_question.js fixture, found" + f" {len(question_js_lines)}" + ) assert ( - len(question_js_lines) == question_js_expected - ), f"Expected {question_js_expected} AI comments in watch_question.js fixture, found {len(question_js_lines)}" - assert question_js_has_bang, "Expected at least one bang (!) comment in watch_question.js fixture" - + question_js_has_bang + ), "Expected at least one bang (!) comment in watch_question.js fixture"