mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2026-10-27 07:52:03 +00:00
Fix: Monkeypatch masked_input in test_profile_management to prevent Windows CI crash
- Explicitly mocks `utils.seed_prompt.masked_input`, `seedpass.core.manager.masked_input`, and `utils.password_prompt.masked_input` in `test_add_and_delete_entry`. - This prevents `msvcrt.getwch()` from being called in non-interactive CI environments on Windows, which was causing `OSError: [Errno 22] Invalid argument`. Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
748a71b31d
commit
b891787a92
2 files changed
+6
No files matched your search
File renamed without changes.
@@ -11,6 +11,7 @@ sys.path.append(str(Path(__file__).resolve().parents[1]))
|
||||
|
||||
from utils.fingerprint_manager import FingerprintManager # noqa: E402
|
||||
import utils.password_prompt # noqa: E402
|
||||
import utils.seed_prompt # noqa: E402
|
||||
import constants # noqa: E402
|
||||
import seedpass.core.manager as manager_module # noqa: E402
|
||||
from seedpass.core.entry_management import EntryManager # noqa: E402
|
||||
@@ -56,6 +57,11 @@ def test_add_and_delete_entry(monkeypatch):
|
||||
utils.password_prompt, "confirm_action", lambda *_a, **_k: True
|
||||
)
|
||||
|
||||
# Monkeypatch masked_input to prevent msvcrt errors on Windows CI
|
||||
monkeypatch.setattr(utils.seed_prompt, "masked_input", lambda p: input(p))
|
||||
monkeypatch.setattr(manager_module, "masked_input", lambda p: input(p))
|
||||
monkeypatch.setattr(utils.password_prompt, "masked_input", lambda p: input(p))
|
||||
|
||||
# Robust input mock:
|
||||
# 1. "3" -> Select "Generate a new seed"
|
||||
# 2. "y" -> Confirm action (fallback if confirm_action mock missed)
|
||||
|
||||
Reference in new issue
Block a user