(
self,
url: str,
username_from_url: str | None,
allowed_types: CredentialType,
)
| 140 | def 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) |