Skip to content

Conversation

@junkmd
Copy link
Collaborator

@junkmd junkmd commented Jan 25, 2026

Overview

This pull request refactors time-related utility functions into a dedicated helper module and introduces new tests for time-sensitive operations within COM monikers and the Running Object Table (ROT).
These changes enhance the modularity of the test suite and improve the coverage of COM interaction capabilities concerning object lifetime and modification timestamps.

Enhanced Test Suite Modularity

Centralized Time-Related Utilities

The SYSTEMTIME structure and associated kernel32 API calls, along with helper functions SystemTimeToFileTime and CompareFileTime, have been extracted from test/test_storage.py into a new, dedicated module: time_structs_helper.py.
This improves the organization and reusability of time-related utilities, making the test suite cleaner and easier to maintain.

Verified Moniker Last Change Time Retrieval

New tests have been added to test/test_moniker.py to specifically validate the IMoniker.GetTimeOfLastChange method.
This test ensures that when a file moniker's underlying file is modified, the GetTimeOfLastChange method accurately reflects the updated modification timestamp.

Accurate Running Object Table Time Management

Tests for IRunningObjectTable have been expanded in test/test_rot.py to cover the NoteChangeTime and GetTimeOfLastChange methods.
These tests verify that the ROT correctly records and retrieves the last change time of registered COM objects.

Moved `SYSTEMTIME` structure and related `kernel32` API calls,
`SystemTimeToFileTime` and `CompareFileTime` helper functions from
`test/test_storage.py` to `test/time_structs_helper.py`.
This improves modularity and reusability of time-related utility functions
within the test suite.
This commit introduces a new test class to `test/test_rot.py`.
It verifies the functionality of `NoteChangeTime` and `GetTimeOfLastChange` by
setting and retrieving the last change time of a registered COM object.
It verifies the functionality of `IMoniker.GetTimeOfLastChange` for file
monikers by creating and modifying a temporary file and asserting that the
`FILETIME` returned by `GetTimeOfLastChange` reflects the modification.
@junkmd junkmd added this to the 1.4.16 milestone Jan 25, 2026
@junkmd junkmd added the tests enhance or fix tests label Jan 25, 2026
@codecov
Copy link

codecov bot commented Jan 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.13%. Comparing base (e51ff94) to head (97f2309).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #914      +/-   ##
==========================================
+ Coverage   87.10%   87.13%   +0.03%     
==========================================
  Files         134      135       +1     
  Lines       12693    12723      +30     
==========================================
+ Hits        11056    11086      +30     
  Misses       1637     1637              

☔ 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.

@junkmd junkmd merged commit c2c2fe5 into enthought:main Jan 25, 2026
52 checks passed
@junkmd junkmd deleted the time_struct_helper branch January 25, 2026 03:07
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