Ejemplo n.º 1
0
def test_load_conf():
    """Test the configuration logging"""
    with pytest.raises(MissingSettings):
        load_conf("nonexistant.toml")
    config = load_conf("tests/test-settings.toml")
    assert config["host"] == "0.0.0.0"
    load_conf(settings_path="tests/test-settings.toml",
              host="127.0.0.1",
              port=4242)
Ejemplo n.º 2
0
def client(loop, aiohttp_client):
    app = identification_app(settings=load_conf("tests/test-settings.toml"))
    app.on_startup.append(load_fake_data)
    return loop.run_until_complete(aiohttp_client(app))
Ejemplo n.º 3
0
def test_load_conf__none_in_parameter(monkeypatch):
    monkeypatch.setattr("pasee.__main__.os.path.join", mocks.join)
    config = load_conf(None)
    assert config["host"] == "0.0.0.0"
Ejemplo n.º 4
0
def test_load_conf__missing_variables_in_conf(monkeypatch):
    with pytest.raises(MissingSettings):
        config = load_conf("tests/test-settings-missing-values.toml")
Ejemplo n.º 5
0
def client(loop, aiohttp_client):
    app = identification_app(settings=load_conf("tests/test-settings.toml"))
    return loop.run_until_complete(aiohttp_client(app))