(
tmp_path: Path, pygit2_empty_key: tuple[Path, str, str]
)
| 119 | @utils.requires_network |
| 120 | @utils.requires_ssh |
| 121 | def test_keypair_from_memory( |
| 122 | tmp_path: Path, pygit2_empty_key: tuple[Path, str, str] |
| 123 | ) -> None: |
| 124 | url = 'ssh://git@github.com/pygit2/empty' |
| 125 | with pytest.raises(pygit2.GitError): |
| 126 | pygit2.clone_repository(url, tmp_path) |
| 127 | |
| 128 | prv, pub, secret = pygit2_empty_key |
| 129 | with open(prv) as f: |
| 130 | prv_mem = f.read() |
| 131 | |
| 132 | with open(pub) as f: |
| 133 | pub_mem = f.read() |
| 134 | |
| 135 | keypair = pygit2.KeypairFromMemory('git', pub_mem, prv_mem, secret) |
| 136 | callbacks = pygit2.RemoteCallbacks(credentials=keypair) |
| 137 | pygit2.clone_repository(url, tmp_path, callbacks=callbacks) |
| 138 | |
| 139 | |
| 140 | def test_callback(testrepo: Repository) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…