gnu: python-pygit2: Update to 0.26.0.

* gnu/packages/python.scm (python-pygit2): Update to 0.26.0.
* gnu/packages/patches/python-pygit2-disable-network-tests.patch: Skip one
more test. Use unittest.skipIf instead of deleting sections.
This commit is contained in:
Marius Bakke 2017-08-18 21:03:30 +02:00
parent 1f9c2351d7
commit 8c0c0c4def
No known key found for this signature in database
GPG key ID: A2A06DF2A33A54FA
2 changed files with 31 additions and 52 deletions

View file

@ -1,64 +1,43 @@
Disable tests trying to look up remote servers. Disable tests trying to look up remote servers.
diff --git a/test/test_credentials.py b/test/test_credentials.py diff --git a/test/test_credentials.py b/test/test_credentials.py
index 92482d9..9a281e5 100644
--- a/test/test_credentials.py --- a/test/test_credentials.py
+++ b/test/test_credentials.py +++ b/test/test_credentials.py
@@ -68,39 +68,5 @@ class CredentialCreateTest(utils.NoRepoTestCase): @@ -68,6 +68,7 @@ class CredentialCreateTest(utils.NoRepoTestCase):
self.assertEqual((username, None, None, None), cred.credential_tuple) self.assertEqual((username, None, None, None), cred.credential_tuple)
-class CredentialCallback(utils.RepoTestCase): +@unittest.skipIf(True, "network tests are not supported in Guix")
- def test_callback(self): class CredentialCallback(utils.RepoTestCase):
- class MyCallbacks(pygit2.RemoteCallbacks): def test_callback(self):
- @staticmethod class MyCallbacks(pygit2.RemoteCallbacks):
- def credentials(url, username, allowed): @@ -92,6 +93,7 @@ class CredentialCallback(utils.RepoTestCase):
- self.assertTrue(allowed & GIT_CREDTYPE_USERPASS_PLAINTEXT) remote = self.repo.create_remote("github", url)
- raise Exception("I don't know the password") self.assertRaises(TypeError, lambda: remote.fetch(callbacks=MyCallbacks()))
-
- url = "https://github.com/github/github" +@unittest.skipIf(True, "network tests are not supported in Guix")
- remote = self.repo.create_remote("github", url) class CallableCredentialTest(utils.RepoTestCase):
-
- self.assertRaises(Exception, lambda: remote.fetch(callbacks=MyCallbacks())) def test_user_pass(self):
-
- 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 diff --git a/test/test_repository.py b/test/test_repository.py
index cfdf01e..c0d8de4 100644
--- a/test/test_repository.py --- a/test/test_repository.py
+++ b/test/test_repository.py +++ b/test/test_repository.py
@@ -538,13 +538,6 @@ class CloneRepositoryTest(utils.NoRepoTestCase): @@ -573,6 +573,7 @@ class CloneRepositoryTest(utils.NoRepoTestCase):
self.assertTrue('refs/remotes/custom_remote/master' in repo.listall_references()) self.assertTrue('refs/remotes/custom_remote/master' in repo.listall_references())
self.assertIsNotNone(repo.remotes["custom_remote"]) self.assertIsNotNone(repo.remotes["custom_remote"])
- def test_clone_with_credentials(self): + @unittest.skipIf(True, "network tests are not supported in Guix")
- repo = clone_repository( def test_clone_with_credentials(self):
- "https://bitbucket.org/libgit2/testgitrepository.git", repo = clone_repository(
- self._temp_dir, callbacks=pygit2.RemoteCallbacks(credentials=pygit2.UserPass("libgit2", "libgit2"))) "https://bitbucket.org/libgit2/testgitrepository.git",
- diff --git a/test/test_submodule.py b/test/test_submodule.py
- self.assertFalse(repo.is_empty) --- a/test/test_submodule.py
- +++ b/test/test_submodule.py
def test_clone_with_checkout_branch(self): @@ -42,6 +42,7 @@ SUBM_PATH = 'submodule'
# create a test case which isolates the remote SUBM_URL = 'https://github.com/libgit2/pygit2'
test_repo = clone_repository('./test/data/testrepo.git', SUBM_HEAD_SHA = '819cbff552e46ac4b8d10925cc422a30aa04e78e'
+@unittest.skipIf(True, "network tests are not supported in Guix")
class SubmoduleTest(utils.SubmoduleRepoTestCase):
def test_lookup_submodule(self):

View file

@ -3910,14 +3910,14 @@ (define-public python2-numpy-documentation
(define-public python-pygit2 (define-public python-pygit2
(package (package
(name "python-pygit2") (name "python-pygit2")
(version "0.25.0") (version "0.26.0")
(source (source
(origin (origin
(method url-fetch) (method url-fetch)
(uri (pypi-uri "pygit2" version)) (uri (pypi-uri "pygit2" version))
(sha256 (sha256
(base32 (base32
"0wf5rp0fvrw7j3j18dvwjq6xqlbm611wd55aphrfpps0v1gxh3ny")) "1cbc488ra3kg7r3qky17ms0szi3cda2d96qfkv1l9djsy9hnvw57"))
(patches (patches
(search-patches "python-pygit2-disable-network-tests.patch")))) (search-patches "python-pygit2-disable-network-tests.patch"))))
(build-system python-build-system) (build-system python-build-system)