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)
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)
def test_config(): assert not create_app().testing assert create_app({"TESTING": True}).testing