Trees | Indices | Help |
|
---|
|
Test gbp.config.GbpOptionParser Test gbp.config.GbpOptionParserDebian
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
__package__ =
|
|
Methods tested:
>>> import gbp.config >>> c = gbp.config.GbpOptionParser('common', prefix='test') >>> c.add_config_file_option(option_name='upstream-branch', dest='upstream') >>> c.add_boolean_config_file_option(option_name='overlay', dest='overlay') >>> c.add_boolean_config_file_option(option_name='track', dest='track') |
Methods tested: >>> import gbp.config >>> c = gbp.config.GbpOptionParserDebian('debian') >>> c.add_config_file_option(option_name='builder', dest='builder') Traceback (most recent call last): ... KeyError: 'builder' >>> c.add_config_file_option(option_name='builder', dest='builder', help='foo') |
Methods tested:
>>> import gbp.config >>> c = gbp.config.GbpOptionParser('debian') >>> g = gbp.config.GbpOptionGroup(c, 'wheezy') >>> g.add_config_file_option(option_name='debian-branch', dest='branch') >>> g.add_boolean_config_file_option(option_name='track', dest='track') |
Methods tested: >>> import gbp.config >>> c = gbp.config.GbpOptionParser('tristate') >>> c.add_config_file_option(option_name="color", dest="color", type='tristate') >>> options, args= c.parse_args(['--color=auto']) >>> options.color auto |
Make sure we also parse git-<subcommands> sections if gbp <subcommand> was used. >>> import os >>> from gbp.config import GbpOptionParser >>> tmpdir = str(context.new_tmpdir('foo')) >>> confname = os.path.join(tmpdir, 'gbp.conf') >>> f = open(confname, 'w') >>> f.write('[DEFAULT]\nthere = was\n[foo]\nthere = is\n[git-foo]\nno = truth\n') >>> f.close() >>> os.environ['GBP_CONF_FILES'] = confname >>> parser = GbpOptionParser('foo') >>> del os.environ['GBP_CONF_FILES'] >>> parser.config['there'] 'is' >>> parser.config['no'] 'truth' |
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu Apr 3 10:35:20 2014 | http://epydoc.sourceforge.net |