From 7123db80453ccb23d9fa66e3e0599269934ed61c Mon Sep 17 00:00:00 2001 From: Zheng Liu Date: Mon, 15 Sep 2025 10:31:18 -0700 Subject: [PATCH 1/2] The expected URL could also have a tailing slash. The URL with tailing slash could also be found in the template commit. --- tasks/github/missing-semester/find_legacy_name/verify.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tasks/github/missing-semester/find_legacy_name/verify.py b/tasks/github/missing-semester/find_legacy_name/verify.py index 42fdca31..3ec3067a 100644 --- a/tasks/github/missing-semester/find_legacy_name/verify.py +++ b/tasks/github/missing-semester/find_legacy_name/verify.py @@ -55,6 +55,7 @@ def verify() -> bool: """ # Expected answer content EXPECTED_CONTENT = "[Hacker Tools](https://hacker-tools.github.io)" + EXPECTED_CONTENT_2 = "[Hacker Tools](https://hacker-tools.github.io/)" # Load environment variables from .mcp_env load_dotenv(".mcp_env") @@ -93,9 +94,9 @@ def verify() -> bool: print("2. Verifying ANSWER.md content...") answer_content = answer_content.strip() - if answer_content != EXPECTED_CONTENT: + if answer_content != EXPECTED_CONTENT and answer_content != EXPECTED_CONTENT_2: print(f"Error: ANSWER.md content does not match expected answer", file=sys.stderr) - print(f"Expected: {EXPECTED_CONTENT}", file=sys.stderr) + print(f"Expected: {EXPECTED_CONTENT} or {EXPECTED_CONTENT_2}", file=sys.stderr) print(f"Found: {answer_content}", file=sys.stderr) return False @@ -104,7 +105,7 @@ 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: {answer_content}") return True From e994563160f41e663e6babf7e59824aeee405aaf Mon Sep 17 00:00:00 2001 From: Zijian Wu <50308536+zjwu0522@users.noreply.github.com> Date: Tue, 16 Sep 2025 02:57:20 +0800 Subject: [PATCH 2/2] chore: tidy style --- .../find_legacy_name/verify.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tasks/github/missing-semester/find_legacy_name/verify.py b/tasks/github/missing-semester/find_legacy_name/verify.py index 3ec3067a..517655da 100644 --- a/tasks/github/missing-semester/find_legacy_name/verify.py +++ b/tasks/github/missing-semester/find_legacy_name/verify.py @@ -53,9 +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_CONTENT_2 = "[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") @@ -94,9 +96,9 @@ def verify() -> bool: print("2. Verifying ANSWER.md content...") answer_content = answer_content.strip() - if answer_content != EXPECTED_CONTENT and answer_content != EXPECTED_CONTENT_2: - print(f"Error: ANSWER.md content does not match expected answer", file=sys.stderr) - print(f"Expected: {EXPECTED_CONTENT} or {EXPECTED_CONTENT_2}", 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 @@ -105,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: {answer_content}") + print(f" - Content accepted: {answer_content}") return True if __name__ == "__main__": success = verify() - sys.exit(0 if success else 1) \ No newline at end of file + sys.exit(0 if success else 1)