aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2018-01-18 13:41:48 +0200
committerGuido Günther <agx@sigxcpu.org>2018-01-20 12:47:16 +0100
commit30114904ff7c06f1cc9e6a47fa4b329a243fa704 (patch)
treeadbf9f9add1ecdd43c3040db406bcba7df319a0f /tests
parent690323271b642e9479fde942e2a362b3d43f6573 (diff)
dch: implement postedit hooks
Add new --postedit command line option for defining a custom hook that will be run after changes to the changelog file has been finalized. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/component/deb/test_dch.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/component/deb/test_dch.py b/tests/component/deb/test_dch.py
index 3d969b14..96c5d5a1 100644
--- a/tests/component/deb/test_dch.py
+++ b/tests/component/deb/test_dch.py
@@ -25,7 +25,7 @@ from tests.component.deb.fixtures import RepoFixtures
import gbp.scripts.dch
from gbp.scripts.dch import main as dch
-from nose.tools import ok_
+from nose.tools import eq_, ok_
def _dsc_file(pkg, version, dir='dsc-3.0'):
@@ -61,3 +61,10 @@ class TestDch(ComponentTestBase):
cl = f.read()
ok_('* testentry\n' in cl)
del gbp.scripts.dch.user_customizations['format_changelog_entry']
+
+ @RepoFixtures.native()
+ def test_postedit_hook(self, repo):
+ os.chdir(repo.path)
+ eq_(dch(['arg0', '-N', '1.2.3', '--postedit', 'echo $GBP_DEBIAN_VERSION > foo.txt']), 0)
+ with open('foo.txt') as f:
+ eq_(f.read(), '1.2.3\n')