Skip to content
Merged
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
17 changes: 10 additions & 7 deletions tasks/github/missing-semester/find_legacy_name/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@ def verify() -> bool:
Programmatically verify that the legacy name finding task was completed correctly.
Checks for ANSWER.md file in master branch with the correct content.
"""
# Expected answer content
EXPECTED_CONTENT = "[Hacker Tools](https://hacker-tools.github.io)"
# Expected answer content (accept both with and without trailing slash)
EXPECTED_CONTENTS = {
"[Hacker Tools](https://hacker-tools.github.io)",
"[Hacker Tools](https://hacker-tools.github.io/)",
}

# Load environment variables from .mcp_env
load_dotenv(".mcp_env")
Expand Down Expand Up @@ -93,9 +96,9 @@ def verify() -> bool:
print("2. Verifying ANSWER.md content...")
answer_content = answer_content.strip()

if answer_content != EXPECTED_CONTENT:
print(f"Error: ANSWER.md content does not match expected answer", file=sys.stderr)
print(f"Expected: {EXPECTED_CONTENT}", file=sys.stderr)
if answer_content not in EXPECTED_CONTENTS:
print(f"Error: ANSWER.md content does not match expected answer(s)", file=sys.stderr)
print(f"Expected one of: {sorted(EXPECTED_CONTENTS)}", file=sys.stderr)
print(f"Found: {answer_content}", file=sys.stderr)
return False

Expand All @@ -104,11 +107,11 @@ def verify() -> bool:
print("\n✅ All verification checks passed!")
print("Legacy name finding task completed successfully:")
print(f" - ANSWER.md created in master branch")
print(f" - Content: {EXPECTED_CONTENT}")
print(f" - Content accepted: {answer_content}")

return True


if __name__ == "__main__":
success = verify()
sys.exit(0 if success else 1)
sys.exit(0 if success else 1)