Skip to content

Add unit tests for repo_issues pure helper functions#118

Open
northline-lab wants to merge 1 commit into
qWaitCrypto:mainfrom
northline-lab:contribarena/e1becb4bbb02-repo-issues-helper-tests
Open

Add unit tests for repo_issues pure helper functions#118
northline-lab wants to merge 1 commit into
qWaitCrypto:mainfrom
northline-lab:contribarena/e1becb4bbb02-repo-issues-helper-tests

Conversation

@northline-lab
Copy link
Copy Markdown
Contributor

Add unit tests for repo_issues pure helper functions. Covers _labels, _has_assignee, _optional_str, _from_gh, _from_rest, and _apply_local_filters with 22 tests. All pass, ruff clean.

Add comprehensive unit tests for six pure helper functions in `contribarena/tools/repo_issues.py`:

- `_labels`: extracts label names from heterogeneous GitHub payloads
- `_has_assignee`: detects assignee presence for a specific issue number
- `_optional_str`: converts truthy values to string or returns None
- `_from_gh`: normalizes GitHub GraphQL issue payloads
- `_from_rest`: normalizes GitHub REST API issue payloads
- `_apply_local_filters`: enforces created_after and no_assignee constraints

These helpers previously had no direct unit test coverage. The new test file includes 22 tests covering normal cases, edge cases (missing fields, incorrect types), and filter combinations. All tests pass and ruff linting is clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant