-
-
Notifications
You must be signed in to change notification settings - Fork 104
Add Anti-Moniker behavior and composition tests. #922
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Assert `IsSystemMoniker` returns `MKSYS_ANTIMONIKER`. - Assert `GetDisplayName` returns `"\.."`. - Assert `GetClassID` returns `CLSID_AntiMoniker`. - Assert `Inverse` raises `COMError` with `MK_E_NOINVERSE`.
- Assert that composing two anti-monikers with `fOnlyGeneric=False` returns a `CLSID_CompositeMoniker`. - Assert that composing two anti-monikers with `fOnlyGeneric=True` raises `COMError` with `MK_E_NEEDGENERIC`.
This commit renames the test method `test_item` to `test_item_with_same_type` within `test_moniker.py`. This change improves the clarity and descriptiveness of the test, making its purpose more explicit.
In `test_item_with_same_type` within `test_moniker.py`, rename `mon` to `left_mon` and `item_mon2` to `right_mon`. This clarifies the roles of the monikers during the `ComposeWith` call.
This commit introduces new test cases in `test_moniker.py` to verify the behavior of composing an anti-moniker with a file moniker. It checks both successful and error scenarios, including handling `MK_E_NEEDGENERIC`.
This commit adds a new test case `test_anti_with_item` to `test_moniker.py`. This test verifies the correct composition behavior of an anti-moniker with an item moniker, including checks for expected COM errors and class IDs.
This commit introduces a new test case `test_file_with_same_type` to `test_moniker.py`. It verifies the behavior of composing file monikers and asserts that `MK_E_SYNTAX` is raised under specific conditions, extending the existing test suite for moniker composition.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #922 +/- ##
==========================================
+ Coverage 88.20% 88.25% +0.05%
==========================================
Files 139 139
Lines 13284 13347 +63
==========================================
+ Hits 11717 11780 +63
Misses 1567 1567 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR introduces comprehensive test coverage for Anti-Monikers and refines existing moniker composition tests.
It ensures that system monikers behave according to the COM specification when inverted or composed with other types, specifically targeting edge case error handling.
Enhanced Reliability in Moniker Operations
Verification of Anti-Moniker System Behavior
The previously unverified system-level behavior of Anti-Monikers, such as display names and inverse operation errors, has become a guaranteed part of the test suite.
Validation of Composition Rules and Errors
Implicit assumptions about moniker composition became explicit assertions for specific COM error codes, ensuring robust handling of invalid operations.