Skip to content

Fix 3 failing tests: path assertion, mock parameter mismatch, unmocke…#447

Merged
kimocoder merged 1 commit into
masterfrom
claude/fix-test-h-failure-1aIoh
Mar 6, 2026
Merged

Fix 3 failing tests: path assertion, mock parameter mismatch, unmocke…#447
kimocoder merged 1 commit into
masterfrom
claude/fix-test-h-failure-1aIoh

Conversation

@kimocoder

Copy link
Copy Markdown
Owner

…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

…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
Copilot AI review requested due to automatic review settings March 6, 2026 00:09
@kimocoder kimocoder merged commit 0d4dd16 into master Mar 6, 2026
11 of 12 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates unit tests to align with the current implementation behavior in system/interface detection and default output path construction.

Changes:

  • Fix HcxDumpToolPassive default output path assertion to match os.path.join(Configuration.temp(), ...).
  • Correct unittest.mock.patch usage in test_non_root_fails by removing a non-injected parameter.
  • Prevent check_interfaces() tests from hitting real system state by mocking the Iw.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.

@kimocoder kimocoder deleted the claude/fix-test-h-failure-1aIoh branch March 6, 2026 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants