Add integration test coverage for keyring authentication (#3067)

Closes https://github.com/astral-sh/uv/issues/2464
This commit is contained in:
Zanie Blue 2024-04-17 12:23:26 -05:00 committed by GitHub
parent e5d4ea55ca
commit 7c5b13c412
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 178 additions and 1 deletions

View file

@ -0,0 +1,23 @@
import json
import os
import sys
from keyring import backend
class KeyringTest(backend.KeyringBackend):
priority = 9
def get_password(self, service, username):
print(f"Request for {username}@{service}", file=sys.stderr)
credentials = json.loads(os.environ.get("KEYRING_TEST_CREDENTIALS") or {})
return credentials.get(service, {}).get(username)
def set_password(self, service, username, password):
raise NotImplementedError()
def delete_password(self, service, username):
raise NotImplementedError()
def get_credential(self, service, username):
raise NotImplementedError()