Skip to content

test: add installer-name matching helper tests for _installer_app_hint and _is_installed_app_installer#32

Open
gaomingyi779-del wants to merge 1 commit into
Vortrix5:mainfrom
gaomingyi779-del:test/add-installer-name-matching-tests
Open

test: add installer-name matching helper tests for _installer_app_hint and _is_installed_app_installer#32
gaomingyi779-del wants to merge 1 commit into
Vortrix5:mainfrom
gaomingyi779-del:test/add-installer-name-matching-tests

Conversation

@gaomingyi779-del

Copy link
Copy Markdown

@

Issue

Closes #29

Changes

Added 18 pytest tests to tests/test_junk.py covering the two pure helper functions in src/sifty/core/junk.py:

TestInstallerAppHint (7 tests)

  • Suffix stripping: setup, installer, install, arch (_x64, _amd64), version
  • Normalisation: lowercasing, hyphen/underscore → space replacement
  • Verifies _windows suffix is correctly stripped

TestIsInstalledAppInstaller (8 tests)

  • Parametrized matrix: exact match, substring match, short hint guard, no-match cases, empty installed set
  • Bidirectional substring matching (hint in name AND name in hint)
  • Short-hint guard (< 3 chars) after suffix stripping

Verification

All 24 tests pass (6 pre-existing + 18 new). No production code changes.

🤖 Generated with Claude Code
@

@
test: add installer-name matching helper tests for _installer_app_hint and _is_installed_app_installer

Adds pytest coverage for the two pure helper functions in sifty.core.junk
that support the downloads-installers category logic (flagging installer
files only for apps the user already has installed).

### TestInstallerAppHint (7 tests)
- Suffix stripping: setup, installer, install, arch (_x64, _amd64), version
- Normalisation: lowercasing, hyphen/underscore → space replacement
- Verifies "_windows" suffix is correctly stripped

### TestIsInstalledAppInstaller (8 tests)
- Parametrized matrix: exact match, substring match, short hint guard,
  no-match cases, empty installed set
- Bidirectional substring matching (hint in name AND name in hint)
- Short-hint guard (< 3 chars) after suffix stripping

All 24 tests pass (18 new + 6 pre-existing).

Co-Authored-By: Claude <noreply@anthropic.com>
@
@github-actions

Copy link
Copy Markdown

Thanks for your first pull request to Sifty! A couple of things that help it land quickly: Sifty deletes files, so all deletion must go through safety.trash() and destructive paths default to dry-run. Please make sure pytest is green (especially tests/test_safety.py) and that the PR title starts with a type tag like (feat) or (fix). See CONTRIBUTING.md for the full checklist. A maintainer will review shortly.

@github-actions github-actions Bot added the tests Test suite label Jun 24, 2026
@Vortrix5

Copy link
Copy Markdown
Owner

Sorry, we do not accept AI Generated PRs.

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

Labels

tests Test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add tests for the installer-name matching helpers in junk.py

2 participants