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-11-14 14:47:20 +0200
commit72fdb2c35c188ad2d14da68befc54241f592467e (patch)
tree8b67c4e33b150488a2c49eee0a3229b050242716 /tests
parent17e6d72c9727d501b73df5dafa05f40f0593fe34 (diff)
downloadgit-buildpackage-72fdb2c35c188ad2d14da68befc54241f592467e.tar.gz
git-buildpackage-72fdb2c35c188ad2d14da68befc54241f592467e.tar.bz2
git-buildpackage-72fdb2c35c188ad2d14da68befc54241f592467e.zip
rpm-ch: implement --commit-msg option
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')