Exemplo n.º 1
0
 def __init__(self, **kwargs):
     # try to load config
     cfg = config.get_config(conf_dir=kwargs.get('conf_dir', config.default_conf_dir))
     pdb = cfg['peeringdb']
     # override config with kwargs
     munge.util.recursive_update(pdb, kwargs)
     super(PeeringDB, self).__init__(**pdb)
Exemplo n.º 2
0
def test_config0():
    cfg_dir = os.path.join(test_dir, 'data', 'config0')
    cfg = config.get_config(cfg_dir)

    assert cfg_dir == cfg['__config_dir__']

    assert default_config['database'] == cfg['database']
    assert default_config['peeringdb'] != cfg['peeringdb']
    assert 60 == cfg['peeringdb']['timeout']
Exemplo n.º 3
0
def test_config0():
    cfg_dir = os.path.join(test_dir, 'data', 'config0')
    cfg = config.get_config(cfg_dir)

    assert cfg_dir == cfg['__config_dir__']

    assert default_config['database'] == cfg['database']
    assert default_config['peeringdb'] != cfg['peeringdb']
    assert 60 == cfg['peeringdb']['timeout']
Exemplo n.º 4
0
def test_config0():
    cfg_dir = os.path.join(test_dir, "data", "config0")
    cfg = config.get_config(cfg_dir)

    assert cfg_dir == cfg["__config_dir__"]

    assert default_config["database"] == cfg["database"]
    assert default_config["peeringdb"] != cfg["peeringdb"]
    assert 60 == cfg["peeringdb"]["timeout"]
Exemplo n.º 5
0
 def __init__(self, **kwargs):
     """
     options:
         conf_dir : directory to load config from
         url      : URL to connect to
         user     : user to connect as
         password : password to use
         timeout  : timeout to fail after
     """
     # try to load config
     cfg = config.get_config(conf_dir=kwargs.get('conf_dir', config.default_conf_dir))
     self.config = cfg['peeringdb']
     # override config with kwargs
     munge.util.recursive_update(self.config, kwargs)
     super(PeeringDB, self).__init__(**self.config)
Exemplo n.º 6
0
 def __init__(self, **kwargs):
     """
     options:
         conf_dir : directory to load config from
         url      : URL to connect to
         user     : user to connect as
         password : password to use
         timeout  : timeout to fail after
     """
     # try to load config
     cfg = config.get_config(
         conf_dir=kwargs.get('conf_dir', config.default_conf_dir))
     self.config = cfg['peeringdb']
     # override config with kwargs
     munge.util.recursive_update(self.config, kwargs)
     super(PeeringDB, self).__init__(**self.config)
Exemplo n.º 7
0
def test_default_config():
    cfg = config.get_config(None)
    assert default_config == cfg
    assert '__config_dir__' not in cfg
Exemplo n.º 8
0
def test_config_dir():
    with pytest.raises(IOError):
        config.get_config('nonexistant')
Exemplo n.º 9
0
def test_config_dir():
    with pytest.raises(IOError):
        config.get_config('nonexistant')
Exemplo n.º 10
0
def test_default_config():
    cfg = config.get_config(None)
    assert default_config == cfg
    assert '__config_dir__' not in cfg