summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-06-05 17:25:25 +0300
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-06-05 17:27:35 +0300
commit0f1fc7f430e6f25ab5f8516ca5f8a79291f86c50 (patch)
treeb2742c639fa9149f3469cbb89892c38951f8e249 /tests
parentdca47ece0d2f0de035dc1d2199ac9716ab9b559f (diff)
downloadgit-buildpackage-0f1fc7f430e6f25ab5f8516ca5f8a79291f86c50.tar.gz
git-buildpackage-0f1fc7f430e6f25ab5f8516ca5f8a79291f86c50.tar.bz2
git-buildpackage-0f1fc7f430e6f25ab5f8516ca5f8a79291f86c50.zip
rpm-ch: implement --commit-msg option
Change-Id: I10e2d4ad30dfd02c73fd0f318375715202ec36c2 Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/component/rpm/test_rpm_ch.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/component/rpm/test_rpm_ch.py b/tests/component/rpm/test_rpm_ch.py
index b8c3bcaf..b69c517e 100644
--- a/tests/component/rpm/test_rpm_ch.py
+++ b/tests/component/rpm/test_rpm_ch.py
@@ -287,6 +287,17 @@ class TestRpmCh(RpmRepoTestBase):
eq_(repo.get_commit_info('HEAD')['files'],
{'M': ['foo.txt', 'gbp-test.spec']})
+ def test_option_commit_msg(self):
+ """Test the --commit-msg cmdline option"""
+ repo = self.init_test_repo('gbp-test2')
+
+ eq_(mock_ch(['--commit', '--since=HEAD^', '--commit-msg=Foo']), 0)
+ eq_(repo.get_commit_info('HEAD')['subject'], 'Foo')
+
+ # Unknown key in format string causes failure
+ eq_(mock_ch(['--commit', '--since=HEAD^', '--commit-msg=%(foo)s']), 1)
+ self._check_log(-1, "gbp:error: Unknown key 'foo' in commit-msg string")
+
def test_tagging(self):
"""Test commiting/tagging"""
repo = self.init_test_repo('gbp-test-native')