-
Notifications
You must be signed in to change notification settings - Fork 13
Shameless Claude test coverage for ModificationMapper #373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Test coverage for: - Initialization with empty/mapping type/custom mappings - Reverse mapping creation (single and list formats) - add_modification_mapping method - UniMod extension functionality 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Test set_modification_mapping with string argument (yaml lookup path) - Test Protein_N-term vs Any_N-term precedence in reverse mapping - Test that add_modification_mapping overwrites existing key values - Clarify docstring: new keys added, existing keys overwritten 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds comprehensive unit test coverage for the ModificationMapper class, focusing on previously untested code paths and edge cases. The tests validate initialization scenarios, mapping operations, and reverse mapping behavior.
Key Changes:
- Added 13 new test cases covering initialization, mapping updates, and reverse mapping generation
- Updated
add_modification_mappingdocstring to clarify that existing keys are overwritten rather than extended - Tests document important behaviors like
Any_N-termprecedence overProtein_N-termin reverse mappings
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/unit/psm_reader/test_modification_mapper.py | New test file with comprehensive coverage for ModificationMapper initialization, mapping operations, and edge cases |
| alphabase/psm_reader/modification_mapper.py | Clarified docstring to document that add_modification_mapping overwrites existing keys rather than extending them |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ) | ||
|
|
||
| # new key is added | ||
| assert "Acetyl@K" in mapper.modification_mapping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you just assert mapper.modification_mapping == expected ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(also in other tests)
Summary
set_modification_mappingwith string argument (yaml lookup code path)Protein_N-termvsAny_N-termprecedence in reverse mappingadd_modification_mappingoverwrites existing key values🤖 Generated with Claude Code