test: cover easy missing branches in report/config/credentials/ssh/wait/job
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user