Skip to content

test: add missing test coverage for config.py (Fixes #36)#37

Merged
KHolodilin merged 4 commits intomainfrom
feature/issue-36-test-coverage
Jan 26, 2026
Merged

test: add missing test coverage for config.py (Fixes #36)#37
KHolodilin merged 4 commits intomainfrom
feature/issue-36-test-coverage

Conversation

@KHolodilin
Copy link
Owner

Description

Adds missing test coverage for email_processor/cli/commands/config.py to reach 100% coverage. Codecov reported 72.72% patch coverage with 3 lines missing.

Changes

  • Added tests for _find_config_example() function:
    • Test finding file in current directory
    • Test finding file in package via importlib.resources
    • Test fallback when package resource not found
  • Added test for create_default_config() when example file is not found
  • Added tests for file overwrite confirmation logic (cancel and confirm)
  • Added test for create_default_config() without rich console (fallback to info)

Testing

  • ✅ All 14 tests pass
  • ✅ Coverage for config.py now reaches 100%
  • ✅ All existing tests still pass
pytest tests/unit/cli/commands/test_config.py -v --cov=email_processor.cli.commands.config --cov-report=term-missing

Coverage Results

Before: 72.72% (3 lines missing)
After: 100% ✅

Checklist

  • Tests added for all missing coverage
  • Coverage reaches 100% for config.py
  • All tests pass
  • Code committed
  • Branch pushed

Fixes #36

- Add config.yaml.example to email_processor package directory
- Configure package-data in pyproject.toml to include config.yaml.example
- Update config.py to find config.yaml.example in package using importlib.resources
- Keep MANIFEST.in for additional files (README.md, LICENSE)
- Files are now accessible in installed package

Fixes #32
- Add README.md to email_processor package directory
- Update package-data to include README.md
- README.md is now accessible in installed package

Fixes #32
- Add tests for _find_config_example() function
  - Test finding file in current directory
  - Test finding file in package via importlib.resources
  - Test fallback when package resource not found
- Add test for create_default_config when example file not found
- Add tests for file overwrite confirmation logic
- Add test for create_default_config without rich console
- Coverage for config.py now reaches 100%
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@KHolodilin KHolodilin merged commit c4dba48 into main Jan 26, 2026
18 checks passed
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.

Bug: Missing test coverage for config.py (72.72% - 3 lines missing)

2 participants