diff options
author | Linn Crosetto <linn@hpe.com> | 2016-09-21 15:59:00 -0600 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2016-10-02 19:35:58 +0200 |
commit | c1b32fa62ee252e4cffb92a64b162ad8f98ca27a (patch) | |
tree | 5564638f5f942c00504f5abd0218390288670a96 /tests | |
parent | f87c21c517a1353424c06d3b1ff7b405bcb9a0a6 (diff) |
dch: avoid adding section in snapshot mode if distribution is UNRELEASED
When using git-dch in snapshot mode, a section is added without checking
whether the distribution is set to UNRELEASED. If the distribution is
UNRELEASED, the version will be incremented but a new section will not be
added, resulting in a skipped version in the changelog.
Change this behavior to add a new section in snapshot mode only if the
distribution is not set to UNRELEASED.
Signed-off-by: Linn Crosetto <linn@hpe.com>
Closes: #838714
Diffstat (limited to 'tests')
-rw-r--r-- | tests/11_test_dch_main.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/11_test_dch_main.py b/tests/11_test_dch_main.py index a6c7876d..e9b64004 100644 --- a/tests/11_test_dch_main.py +++ b/tests/11_test_dch_main.py @@ -339,6 +339,22 @@ class TestScriptDch(DebianGitTestRepo): self.assertIsNotNone(re.search(snap_mark + header.group(1), lines[2])) self.assertIn(""" * added debian/control\n""", lines) + def test_dch_main_unreleased_debian_version_with_snapshot(self): + """Test dch.py like gbp dch script does: snapshot mode with unreleased debian version""" + new_version_1_0 = '1.0-1' + options = ["--commit"] + options.append("--commit-msg=UNRELEASED-version") + lines = self.run_dch() + header = re.search(r"\(%s\) UNRELEASED" % new_version_1_0, lines[0]) + self.assertIsNotNone(header) + options = ["--snapshot", "--auto"] + lines = self.run_dch(options) + header = re.search(snap_header_1, lines[0]) + self.assertIsNotNone(header) + self.assertEqual(header.lastindex, 1) + self.assertIsNotNone(re.search(snap_mark + header.group(1), lines[2])) + self.assertIn(""" * added debian/control\n""", lines) + def test_dch_main_closes_default(self): options = ["--meta"] self.add_file("closes", "test file", |