Persist closed account tabs and add scoped account removal
This commit is contained in:
@@ -208,6 +208,31 @@ class AccountGuiTests(unittest.TestCase):
|
||||
finally:
|
||||
hub.close()
|
||||
|
||||
def test_closed_tab_stays_closed_after_restart_and_can_be_opened_manually(self):
|
||||
with workspace_temp() as folder:
|
||||
hub = AccountsWindow(folder)
|
||||
hub.add_profile()
|
||||
for window in hub.windows.values():
|
||||
window.timer.stop()
|
||||
self.wait(list(hub.windows.values()))
|
||||
closed = hub.profiles[-1]
|
||||
hub.close_profile(hub.tabs.count() - 1)
|
||||
hub.close()
|
||||
restarted = AccountsWindow(folder)
|
||||
for window in restarted.windows.values():
|
||||
window.timer.stop()
|
||||
try:
|
||||
self.wait(list(restarted.windows.values()))
|
||||
self.assertNotIn(closed["id"], restarted.windows)
|
||||
self.assertTrue(any(p["id"] == closed["id"] for p in restarted.profiles))
|
||||
restarted.open_profile(next(p for p in restarted.profiles if p["id"] == closed["id"]))
|
||||
for window in restarted.windows.values():
|
||||
window.timer.stop()
|
||||
self.wait(list(restarted.windows.values()))
|
||||
self.assertIn(closed["id"], restarted.windows)
|
||||
finally:
|
||||
restarted.close()
|
||||
|
||||
def test_failed_resume_saves_counters_before_response_and_keeps_execution_off(self):
|
||||
with workspace_temp() as folder:
|
||||
window = gui.Window(folder)
|
||||
|
||||
Reference in New Issue
Block a user