mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2026-10-27 07:52:03 +00:00
test(ci): mock masked_input in profile management test
Fixes `OSError: [Errno 22] Invalid argument` in Windows CI runs by mocking `utils.password_prompt.masked_input` in `test_add_and_delete_entry`. This prevents `msvcrt.getwch()` from being called in non-interactive environments when `PasswordManager.add_new_fingerprint` requests a password/seed. Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
fe61ff3877
commit
8495df0910
1 file changed
+4
@@ -65,6 +65,10 @@ def test_add_and_delete_entry(monkeypatch):
|
||||
# Using "y" breaks the loop in confirm_action if it gets called.
|
||||
input_values = iter(["3", "y", "y", "y", "y"])
|
||||
monkeypatch.setattr("builtins.input", lambda *_a, **_k: next(input_values))
|
||||
# Patch masked_input to avoid OSError on Windows CI non-interactive envs
|
||||
monkeypatch.setattr(
|
||||
utils.password_prompt, "masked_input", lambda p: next(input_values)
|
||||
)
|
||||
|
||||
pm.add_new_fingerprint()
|
||||
|
||||
|
||||
Reference in new issue
Block a user