mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2025-09-09 15:58:48 +00:00
Merge pull request #559 from PR0M3TH3AN/qechl7-codex/update-show_entry_details_by_index-method
Add pause between entry details and action menu
This commit is contained in:
@@ -1792,7 +1792,7 @@ class PasswordManager:
|
|||||||
pause()
|
pause()
|
||||||
|
|
||||||
def show_entry_details_by_index(self, index: int) -> None:
|
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:
|
try:
|
||||||
entry = self.entry_manager.retrieve_entry(index)
|
entry = self.entry_manager.retrieve_entry(index)
|
||||||
if not entry:
|
if not entry:
|
||||||
@@ -1808,6 +1808,7 @@ class PasswordManager:
|
|||||||
)
|
)
|
||||||
|
|
||||||
self.display_entry_details(index)
|
self.display_entry_details(index)
|
||||||
|
pause()
|
||||||
self._entry_actions_menu(index, entry)
|
self._entry_actions_menu(index, entry)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error(f"Failed to display entry details: {e}", exc_info=True)
|
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",
|
"password_manager.manager.clear_header_with_notification",
|
||||||
lambda *a, **k: header_calls.append(True),
|
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(
|
monkeypatch.setattr(
|
||||||
pm,
|
pm,
|
||||||
"_entry_actions_menu",
|
"_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)
|
monkeypatch.setattr("password_manager.manager.pause", lambda *a, **k: None)
|
||||||
|
|
||||||
pm.show_entry_details_by_index(index)
|
pm.show_entry_details_by_index(index)
|
||||||
|
|
||||||
assert len(header_calls) == 1
|
assert len(header_calls) == 1
|
||||||
assert len(action_calls) == 1
|
assert call_order == ["display", "actions"]
|
||||||
|
Reference in New Issue
Block a user