diff options
author | Guido Günther <agx@sigxcpu.org> | 2014-09-12 13:05:47 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2014-09-12 13:48:34 +0200 |
commit | ee4447920b41cad774f1494c0e2b2312ca3a5a9a (patch) | |
tree | fb705b20b33a37d9caa490187f4d76ed771719b1 /tests | |
parent | e3ea8907d7ef653fe03f0e870a4955deb6a9d9cc (diff) | |
download | git-buildpackage-ee4447920b41cad774f1494c0e2b2312ca3a5a9a.tar.gz git-buildpackage-ee4447920b41cad774f1494c0e2b2312ca3a5a9a.tar.bz2 git-buildpackage-ee4447920b41cad774f1494c0e2b2312ca3a5a9a.zip |
Allow to always drop pq branch after export
Closes: #761160
Diffstat (limited to 'tests')
-rw-r--r-- | tests/13_test_gbp_pq.py | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/tests/13_test_gbp_pq.py b/tests/13_test_gbp_pq.py index 753143d3..910ce206 100644 --- a/tests/13_test_gbp_pq.py +++ b/tests/13_test_gbp_pq.py @@ -21,7 +21,7 @@ import os import logging import unittest -from gbp.scripts.pq import generate_patches +from gbp.scripts.pq import generate_patches, switch_pq, export_patches import gbp.scripts.common.pq as pq import gbp.patch_series import tests.testutils as testutils @@ -132,5 +132,26 @@ class TestWritePatch(testutils.DebianGitTestRepo): # Branches must be identical afterwards self.assertEqual('', diff) +class TestExport(testutils.DebianGitTestRepo): + class Options(object): + drop = True + patch_numbers = False + + def setUp(self): + testutils.DebianGitTestRepo.setUp(self) + self.add_file('bar', 'bar') + + def test_drop(self): + """Test if we drop the patch-queue branch with --drop""" + repo = self.repo + start = repo.get_branch() + pq = os.path.join('patch-queue', start) + switch_pq(repo, start) + self.assertEqual(repo.get_branch(), pq) + export_patches(repo, pq, TestExport.Options) + self.assertEqual(repo.get_branch(), start) + self.assertFalse(repo.has_branch(pq)) + + def _patch_path(name): return os.path.join(context.projectdir, 'tests/data', name) |