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

Function test_clone_bad_credentials

test/test_repository.py:782–795  ·  view source on GitHub ↗
(tmp_path: Path)

Source from the content-addressed store, hash-verified

780
781@utils.requires_network
782def test_clone_bad_credentials(tmp_path: Path) -> None:
783 class MyCallbacks(pygit2.RemoteCallbacks):
784 def credentials(
785 self,
786 url: str,
787 username_from_url: str | None,
788 allowed_types: CredentialType,
789 ) -> Username | UserPass | Keypair:
790 raise RuntimeError('Unexpected error')
791
792 url = 'https://github.com/github/github'
793 with pytest.raises(RuntimeError) as exc:
794 clone_repository(url, tmp_path, callbacks=MyCallbacks())
795 assert str(exc.value) == 'Unexpected error'
796
797
798def test_clone_with_checkout_branch(barerepo: Repository, tmp_path: Path) -> None:

Callers

nothing calls this directly

Calls 2

clone_repositoryFunction · 0.90
MyCallbacksClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…