test: add unit tests for repo_eligibility pure helpers#112
Open
northline-lab wants to merge 1 commit into
Open
test: add unit tests for repo_eligibility pure helpers#112northline-lab wants to merge 1 commit into
northline-lab wants to merge 1 commit into
Conversation
## Summary Add 36 unit tests for four pure helper functions in `contribarena.tools.repo_eligibility` that previously had no dedicated test coverage. ## Test Coverage - **ParseGithubDatetimeTest** (5 tests): ISO format parsing, timezone conversion, edge cases - **LooksEnglishTest** (8 tests): ASCII ratio thresholds, boundary conditions, long text handling - **ProhibitsAiOrBotsTest** (10 tests): All prohibited phrase variants, case sensitivity, partial matches - **IsExternalRecentPrTest** (13 tests): External PR detection, owner/bot filtering, REST API format support, time boundaries ## Verification ``` pytest tests/unit/test_repo_eligibility.py -v # 36 passed ruff check tests/unit/test_repo_eligibility.py # All checks passed! ``` No production code changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add 36 unit tests for four pure helper functions in
contribarena.tools.repo_eligibilitythat previously had no dedicated test coverage.Test Coverage
ParseGithubDatetimeTest (5 tests)
LooksEnglishTest (8 tests)
ProhibitsAiOrBotsTest (10 tests)
IsExternalRecentPrTest (13 tests)
Why This Matters
These pure helper functions are critical for:
Having comprehensive tests ensures the eligibility checker behaves correctly across edge cases.
Verification
Changes
tests/unit/test_repo_eligibility.pywith 4 test classes