Skip to content

test: add unit tests for package_search.py - #2157

Closed
darrenhuai wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
darrenhuai:test/package-search-coverage
Closed

test: add unit tests for package_search.py#2157
darrenhuai wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
darrenhuai:test/package-search-coverage

Conversation

@darrenhuai

Copy link
Copy Markdown

package_search.py didn't have any tests - ResourceSearcher and ResourceSearchResultFormatter were both completely uncovered. Added tests for the search behavior (family/package/variant resolution, glob matching, version ranges, latest-only, after_time/before_time filtering) and the formatter (default qualified-name output, abbreviation expansion, ambiguous abbreviations left as-is, splitting on the literal newline token in output_format).

Reused the existing fixture packages under data/tests and the TestBase/TempdirMixin setup already used elsewhere in the suite, so no new test data needed.

Ran the full suite locally (321 passed), flake8 and ruff are both clean on the new file.

Refs #2092

ResourceSearcher and ResourceSearchResultFormatter had no dedicated
tests. Covers family/package/variant resolution, glob matching,
version ranges, latest-only, after_time/before_time filtering, and
output_format abbreviation expansion.

Refs AcademySoftwareFoundation#2092

Signed-off-by: darrenhuai <60621295+darrenhuai@users.noreply.github.com>
@darrenhuai
darrenhuai requested a review from a team as a code owner July 19, 2026 23:49
@linux-foundation-easycla

Copy link
Copy Markdown

CLA Not Signed

@darrenhuai

Copy link
Copy Markdown
Author

Closing - this duplicates #2149, which is already open and in review for the same file. Opened by mistake while I was in the middle of switching to a different part of #2092. Sorry for the noise.

@darrenhuai darrenhuai closed this Jul 19, 2026
@darrenhuai
darrenhuai deleted the test/package-search-coverage branch July 19, 2026 23:51
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