Extract Time Utility Helpers and Add Moniker/ROT Time-Related Tests#914
Merged
junkmd merged 3 commits intoenthought:mainfrom Jan 25, 2026
Merged
Extract Time Utility Helpers and Add Moniker/ROT Time-Related Tests#914junkmd merged 3 commits intoenthought:mainfrom
junkmd merged 3 commits intoenthought:mainfrom
Conversation
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.
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
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
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 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
SYSTEMTIMEstructure and associatedkernel32API calls, along with helper functionsSystemTimeToFileTimeandCompareFileTime, have been extracted fromtest/test_storage.pyinto 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.pyto specifically validate theIMoniker.GetTimeOfLastChangemethod.This test ensures that when a file moniker's underlying file is modified, the
GetTimeOfLastChangemethod accurately reflects the updated modification timestamp.Accurate Running Object Table Time Management
Tests for
IRunningObjectTablehave been expanded intest/test_rot.pyto cover theNoteChangeTimeandGetTimeOfLastChangemethods.These tests verify that the ROT correctly records and retrieves the last change time of registered COM objects.