Ejemplo n.º 1
0
def app(redis):
    test_path = tempfile.mkdtemp()
    app = create_app({
        "CACHE_PATH": test_path + "/cache",
        "JSON_PATH": test_path + "/json",
        "REDIS_CONN": redis,
        "STORE_PATH": test_path + "/store",
        "TESTING": True,
        "UPSTREAM_URL": "http://localhost:8001",
        "VERSIONS": {
            "metadata_version":
            1,
            "branches": [{
                "name": "snapshot",
                "enabled": True,
                "latest": "snapshot",
                "git_branch": "master",
                "path": "snapshots",
                "pubkey":
                "RWS1BD5w+adc3j2Hqg9+b66CvLR7NlHbsj7wjNVj0XGt/othDgIAOJS+",
                "updates": "dev",
            }],
        },
    })

    yield app

    shutil.rmtree(test_path)
Ejemplo n.º 2
0
def app(redis):
    test_path = tempfile.mkdtemp()
    app = create_app({
        "CACHE_PATH": test_path + "/cache",
        "JSON_PATH": test_path + "/json",
        "REDIS_CONN": redis,
        "STORE_PATH": test_path + "/store",
        "TESTING": True,
        "UPSTREAM_URL": "https://cdn.openwrt.org",
    })

    yield app

    shutil.rmtree(test_path)
Ejemplo n.º 3
0
def test_config():
    assert not create_app().testing
    assert create_app({"TESTING": True}).testing