mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2025-09-10 00:09:04 +00:00
Enhance seed entry prompts with masking and clear screen
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import builtins
|
||||
from mnemonic import Mnemonic
|
||||
from password_manager.manager import PasswordManager
|
||||
from utils import seed_prompt
|
||||
|
||||
|
||||
def test_validate_bip85_seed_invalid_word():
|
||||
@@ -24,6 +25,7 @@ def test_setup_existing_seed_words(monkeypatch):
|
||||
phrase = m.generate(strength=128)
|
||||
words = phrase.split()
|
||||
inputs = iter(words + ["y"] * len(words))
|
||||
monkeypatch.setattr(seed_prompt, "masked_input", lambda *_: next(inputs))
|
||||
monkeypatch.setattr(builtins, "input", lambda *_: next(inputs))
|
||||
|
||||
pm = PasswordManager.__new__(PasswordManager)
|
||||
|
@@ -38,6 +38,7 @@ def test_prompt_seed_words_valid(monkeypatch):
|
||||
words = phrase.split()
|
||||
|
||||
inputs = iter(words + ["y"] * len(words))
|
||||
monkeypatch.setattr(seed_prompt, "masked_input", lambda *_: next(inputs))
|
||||
monkeypatch.setattr("builtins.input", lambda *_: next(inputs))
|
||||
|
||||
result = seed_prompt.prompt_seed_words(len(words))
|
||||
@@ -52,6 +53,7 @@ def test_prompt_seed_words_invalid_word(monkeypatch):
|
||||
words = phrase.split()
|
||||
# Insert an invalid word for the first entry then the correct one
|
||||
inputs = iter(["invalid"] + [words[0]] + words[1:] + ["y"] * len(words))
|
||||
monkeypatch.setattr(seed_prompt, "masked_input", lambda *_: next(inputs))
|
||||
monkeypatch.setattr("builtins.input", lambda *_: next(inputs))
|
||||
|
||||
result = seed_prompt.prompt_seed_words(len(words))
|
||||
|
Reference in New Issue
Block a user