class TestHelp(unittest.TestCase):
"""Test help output of gbp commands"""
- os.environ['PYTHONPATH'] = '.'
def testHelp(self):
- for prog in [ "buildpackage", "import-orig", "import-dsc", "dch" ]:
- ret = os.system("bin/git-%s --help >/dev/null" % prog)
- self.assertEqual(ret, 0)
-
- def testHelpGbp(self):
- for prog in [ "pull", "clone", "pq", "create-remote-repo" ]:
- ret = os.system("bin/gbp-%s --help >/dev/null" % prog)
- self.assertEqual(ret, 0)
+ for script in ['buildpackage',
+ 'clone',
+ 'create_remote_repo',
+ 'dch',
+ 'import_orig',
+ 'import_dsc',
+ 'pull',
+ 'pq']:
+ module = 'gbp.scripts.%s' % script
+ m = __import__(module, globals(), locals(), ['main'], -1)
+ self.assertRaises(SystemExit,
+ m.main,
+ ['doesnotmatter', '--help'])
# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·: