summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
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')