diff options
author | Guido Günther <agx@sigxcpu.org> | 2016-12-23 21:06:34 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2016-12-23 21:20:36 +0100 |
commit | e31f15bf50d956267182512d6c5febb26812ad1a (patch) | |
tree | c5079082abe627485bcb9d5e21a295d773a0e376 /tests/13_test_gbp_pq.py | |
parent | 7b297b719f1a0318b07675dab186cb2ab6459bc5 (diff) |
pq: Don't fail --commit on empty commits
So far we would fail empty commits with the confusing error
$ gbp pq export --commit
gbp:info: Generating patches from git (debian/sid..patch-queue/debian/sid)
gbp:error: Error running git commit:
Diffstat (limited to 'tests/13_test_gbp_pq.py')
-rw-r--r-- | tests/13_test_gbp_pq.py | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/tests/13_test_gbp_pq.py b/tests/13_test_gbp_pq.py index be87f909..c63ee12d 100644 --- a/tests/13_test_gbp_pq.py +++ b/tests/13_test_gbp_pq.py @@ -210,8 +210,12 @@ class TestWritePatch(testutils.DebianGitTestRepo): class TestExport(testutils.DebianGitTestRepo): class Options(object): - drop = True + drop = False patch_numbers = False + renumber = False + patch_num_format = '' + meta_closes = False + meta_closes_bugnum = '' pq_from = 'DEBIAN' def setUp(self): @@ -223,12 +227,36 @@ class TestExport(testutils.DebianGitTestRepo): repo = self.repo start = repo.get_branch() pq_branch = os.path.join('patch-queue', start) + opts = TestExport.Options() + opts.drop = True + pq.switch_pq(repo, start) self.assertEqual(repo.get_branch(), pq_branch) - export_patches(repo, pq_branch, TestExport.Options) + export_patches(repo, pq_branch, opts) self.assertEqual(repo.get_branch(), start) self.assertFalse(repo.has_branch(pq_branch)) + def test_commit(self): + """Test if we commit the patch-queue branch with --commit""" + repo = self.repo + start = repo.get_branch() + pq_branch = os.path.join('patch-queue', start) + opts = TestExport.Options() + opts.commit = True + pq.switch_pq(repo, start) + self.assertEqual(len(repo.get_commits()), 1) + self.assertEqual(repo.get_branch(), pq_branch) + self.add_file('foo', 'foo') + export_patches(repo, pq_branch, opts) + self.assertEqual(repo.get_branch(), start) + self.assertTrue(repo.has_branch(pq_branch)) + self.assertEqual(len(repo.get_commits()), 2, + "Export did not create commit") + export_patches(repo, pq_branch, opts) + self.assertEqual(repo.get_branch(), start) + self.assertEqual(len(repo.get_commits()), 2, + "Export must not create another commit") + class TestParseGbpCommand(unittest.TestCase): def test_empty_body(self): |