Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/test/test_main_invocation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from pathlib import Path


def test_main_uses_static_fill_call():
"""Guard against reintroducing constructor/call mismatch for Fill."""
main_path = Path(__file__).resolve().parents[1] / "main.py"
content = main_path.read_text(encoding="utf-8")

assert "Fill.fill_form(" in content
assert "Fill(user_input=user_input).fill_form(" not in content
Comment on lines +6 to +10
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is brittle because it relies on raw substring matches in main.py. It can produce false positives (e.g., Fill.fill_form( appears in a comment/string) and false negatives (valid calls formatted as Fill.fill_form ( with whitespace/newlines). Consider parsing main.py with ast and asserting there is a Call to attribute Fill.fill_form, and that there is no Call where Fill(...) is invoked and then .fill_form is called.

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

Loading