mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2025-09-08 07:18:47 +00:00
pause after showing entry details
This commit is contained in:
@@ -1792,7 +1792,7 @@ class PasswordManager:
|
||||
pause()
|
||||
|
||||
def show_entry_details_by_index(self, index: int) -> None:
|
||||
"""Display entry details for ``index`` without prompting."""
|
||||
"""Display details for entry ``index`` and offer actions."""
|
||||
try:
|
||||
entry = self.entry_manager.retrieve_entry(index)
|
||||
if not entry:
|
||||
@@ -1808,6 +1808,7 @@ class PasswordManager:
|
||||
)
|
||||
|
||||
self.display_entry_details(index)
|
||||
pause()
|
||||
self._entry_actions_menu(index, entry)
|
||||
except Exception as e:
|
||||
logging.error(f"Failed to display entry details: {e}", exc_info=True)
|
||||
|
@@ -116,15 +116,21 @@ def test_show_entry_details_by_index(monkeypatch):
|
||||
"password_manager.manager.clear_header_with_notification",
|
||||
lambda *a, **k: header_calls.append(True),
|
||||
)
|
||||
action_calls = []
|
||||
|
||||
call_order = []
|
||||
monkeypatch.setattr(
|
||||
pm,
|
||||
"display_entry_details",
|
||||
lambda *a, **k: call_order.append("display"),
|
||||
)
|
||||
monkeypatch.setattr(
|
||||
pm,
|
||||
"_entry_actions_menu",
|
||||
lambda *a, **k: action_calls.append(True),
|
||||
lambda *a, **k: call_order.append("actions"),
|
||||
)
|
||||
monkeypatch.setattr("password_manager.manager.pause", lambda *a, **k: None)
|
||||
|
||||
pm.show_entry_details_by_index(index)
|
||||
|
||||
assert len(header_calls) == 1
|
||||
assert len(action_calls) == 1
|
||||
assert call_order == ["display", "actions"]
|
||||
|
Reference in New Issue
Block a user