Exemplo n.º 1
0
    def test_read_config(self):
        config = read_config('bootstrap.cfg')
        self.assertEqual(config, TEST_CONFIG)

        os.environ['PREFIX'] = '.'
        config = read_config('$PREFIX/bootstrap.cfg')
        self.assertEqual(config, TEST_CONFIG)
Exemplo n.º 2
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.º 3
0
 def setUp(self):
     conf = bootstrap.read_config()
     self.redis = redis.StrictRedis(
         host=conf.get("redis", "host"),
         port=conf.getint("redis", "port"),
         db=conf.getint("redis", "db"))
     self.conn = dbapi.connect(
         host=conf.get("db", "host"),
         port=conf.getint("db", "port"),
         user=conf.get("db", "user"))
     bootstrap.init_db(self.conn)
     self.redis.flushdb()
     self.mapper = redmate.Db2RedisMapper(self.conn, self.redis)
Exemplo n.º 4
0
 def test_read_config_wrong_filename(self):
     config = read_config('does_not_exist.cfg')
     self.assertEqual(config, TEST_EMPTY_CONFIG)