test: cover easy missing branches in report/config/credentials/ssh/wait/job
Lint / pssa (push) Successful in 34s
Lint / python (push) Successful in 41s

This commit is contained in:
2026-05-14 23:23:55 +02:00
parent b2b31f4b6e
commit dc8449a0d7
6 changed files with 371 additions and 0 deletions
+18
View File
@@ -52,6 +52,24 @@ def test_get_falls_back_to_password(monkeypatch: pytest.MonkeyPatch) -> None:
assert cred.password == "tokentoken"
def test_get_raises_keyerror_when_unknown(monkeypatch: pytest.MonkeyPatch) -> None:
_install_fake_keyring(monkeypatch, credential_map={}, password_map={})
with pytest.raises(KeyError):
KeyringCredentialStore().get("missing")
def test_credential_store_protocol_can_be_implemented() -> None:
"""Cover the Protocol body (pass / ...)."""
from ci_orchestrator.credentials import Credential, CredentialStore
class _Impl:
def get(self, target: str) -> Credential:
return Credential(username="u", password="p")
store: CredentialStore = _Impl()
assert store.get("x").username == "u"
def test_get_raises_when_missing(monkeypatch: pytest.MonkeyPatch) -> None:
_install_fake_keyring(monkeypatch, credential_map={}, password_map={})
with pytest.raises(KeyError):