File: 01_test_help.py

package info (click to toggle)
git-buildpackage 0.6.22~bpo70%2B1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 3,296 kB
  • sloc: python: 9,300; xml: 6,943; sh: 416; makefile: 84
file content (37 lines) | stat: -rw-r--r-- 1,215 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# vim: set fileencoding=utf-8 :

"""Check if --help works"""

from . import context

import unittest

class TestHelp(unittest.TestCase):
    """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'], -1)
            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'], -1)
            self.assertRaises(SystemExit,
                              m.main,
                              ['doesnotmatter', '--help'])

# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·: