Fix 3 failing tests: path assertion, mock parameter mismatch, unmocke…#447
Merged
Conversation
…d fallback
- test_initialization_with_defaults: Fix expected path to match os.path.join
output ('/tmp/wifite_/passive_pmkid.pcapng' not '/tmp/wifite_passive_pmkid.pcapng')
- test_non_root_fails: Remove extra mock_name parameter since @patch('os.name', 'posix')
with a concrete replacement value does not inject a mock argument
- test_no_interfaces: Mock Iw.get_interfaces() fallback which uses Process.call
(not subprocess.run) and was returning real system interfaces
https://claude.ai/code/session_016fLGtMyCk1GEeMnKeyedx4
There was a problem hiding this comment.
Pull request overview
Updates unit tests to align with the current implementation behavior in system/interface detection and default output path construction.
Changes:
- Fix
HcxDumpToolPassivedefault output path assertion to matchos.path.join(Configuration.temp(), ...). - Correct
unittest.mock.patchusage intest_non_root_failsby removing a non-injected parameter. - Prevent
check_interfaces()tests from hitting real system state by mocking theIw.get_interfaces()fallback.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
tests/test_system_check.py |
Fixes patch-decorator argument mismatch and mocks the Iw.get_interfaces() fallback to keep tests hermetic. |
tests/test_hcxdumptool.py |
Adjusts expected default output path to match os.path.join behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
…d fallback
https://claude.ai/code/session_016fLGtMyCk1GEeMnKeyedx4