Repository navigation
Mock check_winpe in test_driver_wim and correct its call expectations. - #803
Open
MohammedAlkindi wants to merge 4 commits into
Open
MohammedAlkindi wants to merge 4 commits into
MohammedAlkindi wants to merge 4 commits into
Conversation
The test read the real registry, so its branch depended on the host. Its expectations also mixed WINPE_DISM for mount and unmount with SYS_PNPUTIL for add-driver, which _ProcessWim cannot emit in one run because both derive from the same lru_cache-wrapped check_winpe result. Mocks the probe to False and matches the mount and unmount constants to it. test_driver_wim_winpe already covers the True branch the same way.
Author
|
This still merges cleanly with current |
This branch has not been deployed
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.
test_driver_wimdoes not mockwinpe.check_winpe(), so it reads the host registry and fails on a non-WinPE host. Its expected calls also pairWINPE_DISMfor mount and unmount withSYS_PNPUTILfor add-driver, but_ProcessWimtakes both from the samelru_cache-wrappedcheck_winpe(), so a real run is all-WinPE or all-SYS.This mocks
check_winpe()to returnFalseand corrects the two mount and unmount constants.test_driver_wim_winpealready covers theTruebranch.python_tests.ymlruns onubuntu-latestonly, whereWINPE_DISMequalsSYS_DISM(#796), so CI does not see the mismatch.On Windows 11, Python 3.13.13:
With the mock inverted to
True, the test fails again.