Beispiel #1
0
def test_load_config():
    from metrique.utils import load_config

    try:
        x = load_config()
    except TypeError:
        pass
    else:
        assert False, "Running load_config() did not throw an error"

    x = load_config(path=None)

    config_file = os.path.join(etc, 'test_conf.json')
    x = load_config(path=config_file)
    assert x
    assert x['file'] is True

    try:
        x = load_config(path='BAD_PATH')
    except IOError:
        pass
    else:
        assert False, "Loaded config with bad path"
Beispiel #2
0
def test_load_config():
    from metrique.utils import load_config

    try:
        x = load_config()
    except TypeError:
        pass
    else:
        assert False, "Running load_config() did not throw an error"

    x = load_config(path=None)

    config_file = os.path.join(etc, 'test_conf.json')
    x = load_config(path=config_file)
    assert x
    assert x['file'] is True

    try:
        x = load_config(path='BAD_PATH')
    except IOError:
        pass
    else:
        assert False, "Loaded config with bad path"
Beispiel #3
0
 def load_config(self, path):
     return load_config(path)