summaryrefslogtreecommitdiffhomepage
path: root/tests/01_test_help.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2016-07-04 16:27:38 +0200
committerGuido Günther <agx@sigxcpu.org>2016-07-04 20:34:53 +0200
commitf2ad919cb98b3e1b1a537e2a43ece88961006b29 (patch)
tree773d015715264a2bfd7c71091a2c2f539f9fde24 /tests/01_test_help.py
parent3b4912d70c576aeda70a9290d8e812029bc76a47 (diff)
tests: Check help of all rpm commands as well
Since we need to iterate over all commands in other tests we add a decorator.
Diffstat (limited to 'tests/01_test_help.py')
-rw-r--r--tests/01_test_help.py50
1 files changed, 24 insertions, 26 deletions
diff --git a/tests/01_test_help.py b/tests/01_test_help.py
index b0bb9a13..8e0b10c0 100644
--- a/tests/01_test_help.py
+++ b/tests/01_test_help.py
@@ -4,34 +4,32 @@
from . import context
-import unittest
+from .testutils.data import TestCaseWithData
-class TestHelp(unittest.TestCase):
+
+class TestHelp(TestCaseWithData):
"""Test help output of gbp commands"""
- def testHelp(self):
- for script in ['buildpackage',
- 'clone',
- 'config',
- 'create_remote_repo',
- 'dch',
- 'import_orig',
- 'import_dsc',
- 'pull',
- 'pq']:
- module = 'gbp.scripts.%s' % script
- m = __import__(module, globals(), locals(), ['main'], 0)
- self.assertRaises(SystemExit,
- m.main,
- ['doesnotmatter', '--help'])
-
- """Test help output of RPM-specific commands"""
- def testHelpRpm(self):
- for script in ['import_srpm']:
- module = 'gbp.scripts.%s' % script
- m = __import__(module, globals(), locals(), ['main'], 0)
- self.assertRaises(SystemExit,
- m.main,
- ['doesnotmatter', '--help'])
+ deb_cmds = ['buildpackage',
+ 'config',
+ 'create_remote_repo',
+ 'dch',
+ 'import_orig',
+ 'import_dsc',
+ 'pull',
+ 'pq']
+
+ rpm_cmds = ['buildpackage_rpm',
+ 'import_srpm',
+ 'rpm_ch',
+ 'pq_rpm']
+
+ @TestCaseWithData.feed(deb_cmds + rpm_cmds)
+ def testHelp(self, script):
+ module = 'gbp.scripts.%s' % script
+ m = __import__(module, globals(), locals(), ['main'], 0)
+ self.assertRaises(SystemExit,
+ m.main,
+ ['doesnotmatter', '--help'])
# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·: