Remove remote-calling unit tests

This fixes the build in Koji.

Not bumping, the package wouldn't build before.
This commit is contained in:
Mathieu Bridon 2014-06-29 18:38:37 +02:00
parent 234f238e8f
commit a8a0b3f20d
2 changed files with 67 additions and 0 deletions

View File

@ -0,0 +1,62 @@
From f56fb3697c1ac9d42585cd1a0bb33b6d8d1304cb Mon Sep 17 00:00:00 2001
From: Mathieu Bridon <bochecha@fedoraproject.org>
Date: Sun, 29 Jun 2014 18:27:33 +0200
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 | 18 ------------------
test/test_repository.py | 8 --------
2 files changed, 26 deletions(-)
diff --git a/test/test_credentials.py b/test/test_credentials.py
index 3bdeb6f..22dbacc 100644
--- a/test/test_credentials.py
+++ b/test/test_credentials.py
@@ -71,23 +71,5 @@ class CredentialCallback(utils.RepoTestCase):
self.assertRaises(Exception, remote.fetch)
- def test_bad_cred_type(self):
- def credentials_cb(url, username, allowed):
- self.assertTrue(allowed & GIT_CREDTYPE_USERPASS_PLAINTEXT)
- return Keypair("git", "foo.pub", "foo", "sekkrit")
-
- remote = self.repo.create_remote("github", "https://github.com/github/github")
- remote.credentials = credentials_cb
-
- self.assertRaises(TypeError, remote.fetch)
-
-class CallableCredentialTest(utils.RepoTestCase):
-
- def test_user_pass(self):
- remote = self.repo.create_remote("bb", "https://bitbucket.org/libgit2/testgitrepository.git")
- remote.credentials = UserPass("libgit2", "libgit2")
-
- remote.fetch()
-
if __name__ == '__main__':
unittest.main()
diff --git a/test/test_repository.py b/test/test_repository.py
index 4d6472e..7ba9c73 100644
--- a/test/test_repository.py
+++ b/test/test_repository.py
@@ -477,14 +477,6 @@ class CloneRepositoryTest(utils.NoRepoTestCase):
clone_into(repo, remote)
self.assertTrue('refs/remotes/origin/master' in repo.listall_references())
- def test_clone_with_credentials(self):
- credentials = pygit2.UserPass("libgit2", "libgit2")
- repo = clone_repository(
- "https://bitbucket.org/libgit2/testgitrepository.git",
- self._temp_dir, credentials=credentials)
-
- self.assertFalse(repo.is_empty)
-
# FIXME The tests below are commented because they are broken:
#
# - test_clone_push_url: Passes, but does nothing useful.
--
1.9.3

View File

@ -19,6 +19,8 @@ BuildRequires: python2-devel
BuildRequires: python-nose BuildRequires: python-nose
BuildRequires: python-setuptools BuildRequires: python-setuptools
Patch0: 0001-Remove-remote-calling-unit-tests.patch
%description %description
pygit2 is a set of Python bindings to the libgit2 library, which implements pygit2 is a set of Python bindings to the libgit2 library, which implements
the core of Git. Pygit2 works with Python 2.7, 3.1, 3.2, 3.3 and 3.4. the core of Git. Pygit2 works with Python 2.7, 3.1, 3.2, 3.3 and 3.4.
@ -48,6 +50,9 @@ Documentation for %{name}.
%prep %prep
%setup -qn %{pkgname}-%{version} %setup -qn %{pkgname}-%{version}
%patch0 -p1
rm -rf %{py3dir} rm -rf %{py3dir}
cp -a . %{py3dir} cp -a . %{py3dir}