Set locked status on window title when locked. Don't exit on incorrect key, let it be tried again
All checks were successful
CI / test (push) Successful in 4m35s
Lint / test (push) Successful in 31s
Trivy / test (push) Successful in 23s

This commit is contained in:
Miguel Jacq 2025-11-25 10:46:11 +11:00
parent 648031786a
commit 26737fbfb2
Signed by: mig5
GPG key ID: 59B3F0C24135C6A9
7 changed files with 11 additions and 21 deletions

View file

@ -470,22 +470,7 @@ def test_try_connect_maps_errors(
mwmod.QMessageBox, "critical", staticmethod(fake_critical), raising=True
)
# Intercept sys.exit so the test process doesn't actually die
exited = {}
def fake_exit(code=0):
exited["code"] = code
# mimic real behaviour: raise SystemExit so callers see a fatal exit
raise SystemExit(code)
monkeypatch.setattr(mwmod.sys, "exit", fake_exit, raising=True)
# _try_connect should now raise SystemExit instead of returning
with pytest.raises(SystemExit):
w._try_connect()
# We attempted to exit with code 1
assert exited["code"] == 1
w._try_connect()
# And we still showed the right error message
assert "database" in shown["title"].lower()