aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/11_test_dch_main.py
diff options
context:
space:
mode:
authorDaniel Dehennin <daniel.dehennin@baby-gnu.org>2011-11-21 19:57:18 +0100
committerGuido Günther <agx@sigxcpu.org>2013-04-06 18:30:00 +0200
commit920053ee48d61df6166f21aa0f57e40480cc4cdc (patch)
tree930a36ad74b280050fad15f8edc7e85e34444b54 /tests/11_test_dch_main.py
parentae4a3683c3becac1c6dcc8efb2eececb7a630c32 (diff)
Add urgency management.
* tests/11_test_dch_main.py: test the new --urgency option to dch.main(). Add only meaningful tests, i.e. options alone and combined with --release and --snapshot. * git-dch (fixup_section): Manage "urgency" option. (main): Add version_group option "-U" and "--urgency" to set the urgency level of the entry. * docs/manpages/git-dch.sgml: Update documentation for new option.
Diffstat (limited to 'tests/11_test_dch_main.py')
-rw-r--r--tests/11_test_dch_main.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/11_test_dch_main.py b/tests/11_test_dch_main.py
index 36431ef7..e43709c3 100644
--- a/tests/11_test_dch_main.py
+++ b/tests/11_test_dch_main.py
@@ -267,6 +267,35 @@ class TestScriptDch(DebianGitTestRepo):
self.assertIn(""" * TEST-COMMITTED-SNAPSHOT\n""", lines)
+ def test_dch_main_new_upstream_version_with_urgency(self):
+ """Test dch.py like git-dch script does: new upstream version - set urgency"""
+ options = ["--urgency=emergency"]
+ lines = self.run_dch(options)
+ self.assertEqual("test-package (1.0-1) UNRELEASED; urgency=emergency\n", lines[0])
+ self.assertIn(""" * added debian/control\n""", lines)
+
+
+ def test_dch_main_new_upstream_version_with_release_urgency(self):
+ """Test dch.py like git-dch script does: new upstream version - release - set urgency"""
+ options = ["--release"]
+ options.append("--urgency=emergency")
+ lines = self.run_dch(options)
+ self.assertEqual("test-package (1.0-1) unstable; urgency=emergency\n", lines[0])
+ self.assertIn(""" * added debian/control\n""", lines)
+
+
+ def test_dch_main_new_upstream_version_with_snapshot_urgency(self):
+ """Test dch.py like git-dch script does: new upstream version - snapshot mode - set urgency"""
+ options = ["--snapshot"]
+ options.append("--urgency=emergency")
+ 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_increment_debian_version(self):
"""Test dch.py like git-dch script does: increment debian version"""
self.repo.delete_tag("debian/0.9-1")