Exemplo n.º 1
0
    def test_override_bootstrap_options(self):
        parser = init_parser()
        options, args = parser.parse_args(['-u', '-p', 'pre-reqs.txt'])

        config = read_config('bootstrap.cfg')
        options = override_bootstrap_options(options, config['bootstrap'])

        self.assertEqual(options.pre_requirements, 'pre-requirements.txt')
        self.assertFalse(options.upgrade)
Exemplo n.º 2
0
    def test_init_parser(self):
        data = (
            ('-h', '--help', None),
            ('-p', '--pre-requirements', 'pre_requirements'),
            ('-E', '--virtualenv', 'virtualenv'),
            ('-P', '--python', 'interpreter'),
            ('-s', '--no-site', 'no_site'),
            ('-u', '--upgrade', 'upgrade'),
            ('-b', '--disable-bootstrap-update', 'disable_bootstrap_update'),
            ('-c', '--config', 'config')
        )
        parser = init_parser()

        for i, option in enumerate(parser.option_list):
            short_opt, long_opt, dest = data[i]

            self.assertEqual(option._short_opts[0], short_opt)
            self.assertEqual(option._long_opts[0], long_opt)
            self.assertEqual(option.dest, dest)