From 509cb3b15b6f32a7e9dd1a5f96fbd2ba9b0d86d6 Mon Sep 17 00:00:00 2001 From: Mathieu Bridon Date: Wed, 21 Jan 2015 09:33:46 +0100 Subject: [PATCH] Remove remote-calling unit tests These can only fail when building in Koji, as the builder can't access the Internet. --- test/test_credentials.py | 21 --------------------- test/test_repository.py | 7 ------- 2 files changed, 28 deletions(-) diff --git a/test/test_credentials.py b/test/test_credentials.py index 92482d9..36263c0 100644 --- a/test/test_credentials.py +++ b/test/test_credentials.py @@ -81,26 +81,5 @@ class CredentialCallback(utils.RepoTestCase): self.assertRaises(Exception, lambda: remote.fetch(callbacks=MyCallbacks())) - def test_bad_cred_type(self): - class MyCallbacks(pygit2.RemoteCallbacks): - @staticmethod - def credentials(url, username, allowed): - self.assertTrue(allowed & GIT_CREDTYPE_USERPASS_PLAINTEXT) - return Keypair("git", "foo.pub", "foo", "sekkrit") - - url = "https://github.com/github/github" - remote = self.repo.create_remote("github", url) - self.assertRaises(TypeError, lambda: remote.fetch(callbacks=MyCallbacks())) - -class CallableCredentialTest(utils.RepoTestCase): - - def test_user_pass(self): - credentials = UserPass("libgit2", "libgit2") - callbacks = pygit2.RemoteCallbacks(credentials=credentials) - - url = "https://bitbucket.org/libgit2/testgitrepository.git" - remote = self.repo.create_remote("bb", url) - remote.fetch(callbacks=callbacks) - if __name__ == '__main__': unittest.main() diff --git a/test/test_repository.py b/test/test_repository.py index 8558340..e127cc4 100644 --- a/test/test_repository.py +++ b/test/test_repository.py @@ -513,13 +513,6 @@ class CloneRepositoryTest(utils.NoRepoTestCase): self.assertTrue('refs/remotes/custom_remote/master' in repo.listall_references()) self.assertIsNotNone(repo.remotes["custom_remote"]) - def test_clone_with_credentials(self): - repo = clone_repository( - "https://bitbucket.org/libgit2/testgitrepository.git", - self._temp_dir, callbacks=pygit2.RemoteCallbacks(credentials=pygit2.UserPass("libgit2", "libgit2"))) - - self.assertFalse(repo.is_empty) - def test_clone_with_checkout_branch(self): # create a test case which isolates the remote test_repo = clone_repository('./test/data/testrepo.git', -- 2.7.1