Skip to content

Conversation

@junkmd
Copy link
Collaborator

@junkmd junkmd commented Jan 31, 2026

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.

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.
@junkmd junkmd added this to the 1.4.16 milestone Jan 31, 2026
@junkmd junkmd added the tests enhance or fix tests label Jan 31, 2026
@codecov
Copy link

codecov bot commented Jan 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.94%. Comparing base (338e34d) to head (c504105).
⚠️ Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.
@junkmd junkmd merged commit 06879ab into enthought:main Jan 31, 2026
52 checks passed
@junkmd junkmd deleted the conn_pts_tests branch January 31, 2026 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests enhance or fix tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant