Skip to content

test: add unit tests for discovery_queries() and chunked() - #92

Merged
TanbirRamim merged 2 commits into
TanbirRamim:mainfrom
yunaremaia:test/discovery-queries-and-chunked
Oct 10, 2026
Merged

TanbirRamim merged 2 commits into
TanbirRamim:mainfrom
yunaremaia:test/discovery-queries-and-chunked

Conversation

@yunaremaia

Copy link
Copy Markdown
Contributor

Adds unit tests for two functions in scripts/radar.py as requested in issue #75.

DiscoveryTests — tests for discovery_queries() with language='Rust', config with min_stars=500 and pushed_within_days=60, and date(2026, 10, 1):

  • Verifies the language is quoted: language:"Rust"
  • Verifies min stars qualifier: stars:>=500
  • Verifies pushed date qualifier: pushed:>=2026-08-02 (60 days before 2026-10-01)
  • Verifies two issue qualifiers are present: good-first-issues:>=1 and help-wanted-issues:>=1

ChunkedTests — tests for chunked():

  • Empty list returns no chunks
  • Exact multiple of size produces equal chunks
  • Remainder produces a final smaller chunk

All 36 tests pass with python3.12 -m unittest discover scripts. Ruff check and format are clean.

Fixes #75

Add DiscoveryTests covering language quoting, min stars, pushed date,
and the two issue qualifiers (good-first-issues, help-wanted-issues).
Add ChunkedTests covering empty list, exact multiple, and remainder.

Fixes TanbirRamim#75

Signed-off-by: Yunare Maia <yunare@gmail.com>
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for the pull request, @yunaremaia. Before a maintainer reviews it, one thing needs a look:

PR template was removed [please check]

The description doesn't follow this repo's pull request template.

Please edit the description and paste the template back in, then fill it out. You can find it in the repo under .github/.

Passed: linked issue, issue claim, recent pull requests, account history, diff scope.

This comment is from pr-doorman, a set of plain rules the maintainers turned on. It doesn't use AI. It updates itself when you edit or push to the pull request.

@TanbirRamim

Copy link
Copy Markdown
Owner

nice, clean tests! I added one more that pins the whole query string, so the archived:false / fork:false / is:public filters are covered too (dropping one of those would quietly pull forks into the radar).

@TanbirRamim
TanbirRamim merged commit 89c8790 into TanbirRamim:main Oct 10, 2026
6 checks passed
@TanbirRamim

Copy link
Copy Markdown
Owner

merged, thanks @yunaremaia! if the radar's been useful to you, a star helps other newcomers find it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add tests for discovery_queries() and chunked()

2 participants