Update unit tests for new Catalog.create() API, fix lint violations, and add GitHub Actions CI#18
Update unit tests for new Catalog.create() API, fix lint violations, and add GitHub Actions CI#18
Conversation
Co-authored-by: mekarpeles <978325+mekarpeles@users.noreply.github.com>
|
@copilot can you please resolve these conflicts and also add a github action to run tests and the most basic linting? |
I've resolved the merge conflicts by rebasing onto the latest main branch (commit decd070) and updated all tests to work with the new I've also added a GitHub Actions workflow (
All 27 tests are passing with 91% coverage (commits 08e4494 and b444acf). However, I'm unable to push these changes because the automated push process tries to rebase against the remote branch, which creates conflicts since the remote is based on an older main. The local branch is correctly based on the latest main and ready to merge. You may need to manually merge or allow force-push to update the PR. |
PR #16 introduced a new API where
SearchResponseis a nested dataclass insideDataProviderwith refactored parameters, but the unit tests weren't updated and there were lint violations inprovider.pyandmodels.py.Changes
Merge Conflict Resolution
decd070)DataProvider.SearchResponseas nested class with individual parameters instead ofSearchRequestobjectCore API Updates
opds2/models.py: FixedCatalog.create()to useMetadata(title="OPDS Catalog")as default instead of bareMetadata()to prevent Pydantic validation errorsopds2/models.py: Removed unusedurlencodeimportopds2/helpers.py: Fixed spacing issues and added newline at end of fileTest Updates
tests/test_catalog.py: Completely rewroteMockDataProviderto use newDataProvider.SearchResponseAPI with static methods returning nested dataclasstests/test_integration.py: Updated all integration tests to use newCatalog.create(response=...)signaturetests/test_models.py: All tests continue to pass (no changes needed)GitHub Actions CI/CD
.github/workflows/test.yml: Added comprehensive CI pipelineExample Usage
The new API pattern demonstrated in tests:
All 27 tests now pass with 91% coverage.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.