Skip to content

Commit

Permalink
refactor: rename watcher to comment_processor
Browse files Browse the repository at this point in the history
Improve variable naming by changing 'watcher' to more descriptive
'comment_processor' to better reflect its purpose in the test file. This
enhances code readability and maintains consistent naming convention.
  • Loading branch information
aweis89 committed Jan 6, 2025
1 parent 3f74259 commit 8597692
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/basic/test_comment_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ def get_rel_fname(self, fname):

io = InputOutput(pretty=False, fancy_input=False, yes=False)
coder = MinimalCoder(io)
watcher = CommentProcessor(io, coder)
comment_processor = CommentProcessor(io, coder)
fixtures_dir = Path(__file__).parent.parent / "fixtures"

# Test Python fixture
py_path = fixtures_dir / "watch.py"
py_lines, py_comments, py_has_bang = watcher.get_ai_comments(str(py_path))
py_lines, py_comments, py_has_bang = comment_processor.get_ai_comments(str(py_path))

# Count unique AI comments (excluding duplicates and variations with extra spaces)
unique_py_comments = set(comment.strip().lower() for comment in py_comments)
Expand All @@ -93,7 +93,7 @@ def get_rel_fname(self, fname):

# Test JavaScript fixture
js_path = fixtures_dir / "watch.js"
js_lines, js_comments, js_has_bang = watcher.get_ai_comments(str(js_path))
js_lines, js_comments, js_has_bang = comment_processor.get_ai_comments(str(js_path))
js_expected = 16
assert (
len(js_lines) == js_expected
Expand All @@ -102,8 +102,8 @@ def get_rel_fname(self, fname):

# 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 = (
comment_processor.get_ai_comments(str(question_js_path))
)
question_js_expected = 6
assert len(question_js_lines) == question_js_expected, (
Expand Down

0 comments on commit 8597692

Please sign in to comment.