01_test_help.py 958 B

123456789101112131415161718192021222324252627282930313233343536
  1. # vim: set fileencoding=utf-8 :
  2. """Check if --help works"""
  3. from . import context # noqa: F401
  4. from .testutils.data import TestCaseWithData
  5. class TestHelp(TestCaseWithData):
  6. """Test help output of gbp commands"""
  7. deb_cmds = ['buildpackage',
  8. 'config',
  9. 'create_remote_repo',
  10. 'dch',
  11. 'import_orig',
  12. 'import_dsc',
  13. 'pull',
  14. 'pq']
  15. rpm_cmds = ['buildpackage_rpm',
  16. 'import_srpm',
  17. 'rpm_ch',
  18. 'pq_rpm']
  19. @TestCaseWithData.feed(deb_cmds + rpm_cmds)
  20. def testHelp(self, script):
  21. module = 'gbp.scripts.%s' % script
  22. m = __import__(module, globals(), locals(), ['main'], 0)
  23. self.assertRaises(SystemExit,
  24. m.main,
  25. ['doesnotmatter', '--help'])
  26. # vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·: