MCPcopy Create free account
hub / github.com/libgit2/pygit2 / MyCallbacks

Class MyCallbacks

test/test_credentials.py:141–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139
140def test_callback(testrepo: Repository) -> None:
141 class MyCallbacks(pygit2.RemoteCallbacks):
142 def credentials(
143 self,
144 url: str,
145 username_from_url: str | None,
146 allowed_types: CredentialType,
147 ) -> Username | UserPass | Keypair:
148 assert allowed_types & CredentialType.USERPASS_PLAINTEXT
149 raise Exception("I don't know the password")
150
151 url = 'https://github.com/github/github'
152 remote = testrepo.remotes.create('github', url)

Callers 3

test_callbackFunction · 0.70
test_bad_cred_typeFunction · 0.70

Calls

no outgoing calls

Tested by 3

test_callbackFunction · 0.56
test_bad_cred_typeFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…