-
-
Notifications
You must be signed in to change notification settings - Fork 104
Add tests for COM connection point interfaces. #919
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
This new test file, `test/test_connectionpoints.py`, verifies the functionality of `connectionpoints` methods to ensure proper COM connection point management.
Adds `test_EnumConnectionPoints` to `test_connectionpoints.py`. This test verifies the correct enumeration of connection points and ensures that each enumerated connection point properly returns its `IConnectionPointContainer`.
This commit introduces `Test_IConnectionPoint` to `test_connectionpoints.py`. It verifies the `IConnectionPoint.GetConnectionInterface` method, ensuring that the correct interface ID is returned for a connection point.
This test verifies the `IConnectionPoint.GetConnectionPointContainer` method, ensuring that the connection point correctly returns its owning `IConnectionPointContainer`.
…ests. This commit adds `test_Advise_Unadvise` to `Test_IConnectionPoint` in `test_connectionpoints.py`. It introduces a `Sink` class as a COM event receiver and verifies the functionality of `IConnectionPoint.Advise` and `IConnectionPoint.Unadvise` methods, ensuring proper connection and disconnection of event sinks.
This commit adds `test_EnumConnections` to the `Test_IConnectionPoint` class in `test_connectionpoints.py`. This test verifies the correct enumeration of active connections and ensures that the returned connection data (interface pointer and cookie) matches the advised sink.
Adds comments to `test_Advise_Unadvise` in `test_connectionpoints.py` to explicitly state the intent of each assertion regarding the connection status before and after `Advise` and `Unadvise` calls.
Moves the `Sink` class definition into a `create_sink` class method within `Test_IConnectionPoint` in `test_connectionpoints.py`. This change encapsulates the `Sink` object creation logic.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #919 +/- ##
==========================================
+ Coverage 87.80% 87.94% +0.14%
==========================================
Files 137 138 +1
Lines 13074 13153 +79
==========================================
+ Hits 11479 11568 +89
+ Misses 1595 1585 -10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Introduces a new test class `Test_Sink` in `test_connectionpoints.py` to verify proper event sinking mechanisms.
Adjusts the `create_sink_and_log` method in `test_connectionpoints.py` to return the `IUnknown` interface. This change emphasizes that COM objects are handled as pointers in the COM world, rather than being tied to specific Python types or attributes.
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.
Summary
This pull request introduces comprehensive test coverage for COM connection point interfaces.
It ensures the correct behavior of connection point enumeration, retrieval, and the advising/unadvising of event sinks, thereby enhancing the reliability of COM event handling.