summaryrefslogtreecommitdiff
path: root/tests/13_test_gbp_pq.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2012-11-23 18:32:34 +0100
committerGuido Günther <agx@sigxcpu.org>2012-11-23 19:24:12 +0100
commit395209152ef4ef4e0b17b239462bc470513b5540 (patch)
tree4c6f22a438fe5d6976586117a2b60b414f8b16ac /tests/13_test_gbp_pq.py
parentd248720ff924801d8e3de6291d3b2e512169a3ca (diff)
downloadgit-buildpackage-395209152ef4ef4e0b17b239462bc470513b5540.tar.gz
git-buildpackage-395209152ef4ef4e0b17b239462bc470513b5540.tar.bz2
git-buildpackage-395209152ef4ef4e0b17b239462bc470513b5540.zip
pq: Allow to pass in custom fucntion to fetch authorship information
so the RPM based tools don't need to rely on a control file but can e.g. look at the spec file.
Diffstat (limited to 'tests/13_test_gbp_pq.py')
-rw-r--r--tests/13_test_gbp_pq.py31
1 files changed, 26 insertions, 5 deletions
diff --git a/tests/13_test_gbp_pq.py b/tests/13_test_gbp_pq.py
index 9fba870f..f6a13ab3 100644
--- a/tests/13_test_gbp_pq.py
+++ b/tests/13_test_gbp_pq.py
@@ -21,10 +21,12 @@ class TestApplyAndCommit(testutils.DebianGitTestRepo):
patch = gbp.patch_series.Patch(
os.path.join(os.path.abspath(os.path.curdir),
'tests/data/foo.patch'))
-
- gbp.scripts.common.pq.apply_and_commit_patch(self.repo, patch)
+
+ gbp.scripts.common.pq.apply_and_commit_patch(self.repo, patch, None)
self.assertIn('foo', self.repo.list_files())
+
+
@unittest.skipIf(not os.path.exists('/usr/bin/dpkg'), 'Dpkg not found')
def test_debian_missing_author(self):
"""
@@ -43,14 +45,33 @@ class TestApplyAndCommit(testutils.DebianGitTestRepo):
# Fake a control file
self.add_file("debian/control",
"Maintainer: Guido Günther <gg@godiug.net>")
-
- gbp.scripts.common.pq.apply_and_commit_patch(self.repo, patch)
+
+ c = gbp.scripts.common.pq.get_maintainer_from_control
+ gbp.scripts.common.pq.apply_and_commit_patch(self.repo,
+ patch,
+ c)
info = self.repo.get_commit_info('HEAD')
self.assertEqual(info['author'].email, 'gg@godiug.net')
self.assertIn('foo', self.repo.list_files())
+class TestApplySinglePatch(testutils.DebianGitTestRepo):
+ """Test L{gbp.pq}'s """
+
+ def setUp(self):
+ testutils.DebianGitTestRepo.setUp(self)
+ self.add_file('bar')
+
+ def test_apply_single_patch(self):
+ """Test applying a single patch"""
+ patch = gbp.patch_series.Patch(
+ os.path.join(os.path.abspath(os.path.curdir),
+ 'tests/data/foo.patch'))
+
+ gbp.scripts.common.pq.apply_single_patch(self.repo, 'master', patch,
+ None)
+ self.assertIn('foo', self.repo.list_files())
+
-