From ff72f1ade42f0bc3e026e999a794a71aa3931388 Mon Sep 17 00:00:00 2001 From: phact Date: Mon, 13 Oct 2025 09:59:26 -0400 Subject: [PATCH] undo wrong fix --- tests/integration/test_api_endpoints.py | 46 ------------------------- 1 file changed, 46 deletions(-) diff --git a/tests/integration/test_api_endpoints.py b/tests/integration/test_api_endpoints.py index e5a417d6..eda4d7ea 100644 --- a/tests/integration/test_api_endpoints.py +++ b/tests/integration/test_api_endpoints.py @@ -1,54 +1,9 @@ import asyncio import os -import json from pathlib import Path import httpx import pytest -from dotenv import dotenv_values, find_dotenv, load_dotenv - - -def _extract_flow_id(flow_file: str) -> str | None: - path = Path(flow_file) - if not path.is_file(): - return None - try: - data = json.loads(path.read_text()) - if isinstance(data, dict): - return data.get("id") or data.get("flow_id") - except Exception: - return None - return None - - -def _prime_langflow_env(required_keys: list[str]) -> None: - """Populate required Langflow env vars from .env or fallback assets when absent.""" - loaded_env_path = find_dotenv(usecwd=True) - if loaded_env_path: - load_dotenv(loaded_env_path, override=False) - - env_sources = {} - candidate_paths = [] - if loaded_env_path: - candidate_paths.append(Path(loaded_env_path)) - candidate_paths.append(Path(".env")) - candidate_paths.append(Path(".env.example")) - - for candidate in candidate_paths: - if candidate.is_file(): - env_sources.update(dotenv_values(candidate)) - - for key in required_keys: - if os.getenv(key): - continue - value = env_sources.get(key) - if not value: - if key == "LANGFLOW_CHAT_FLOW_ID": - value = _extract_flow_id("flows/openrag_agent.json") - elif key == "NUDGES_FLOW_ID": - value = _extract_flow_id("flows/openrag_nudges.json") - if value: - os.environ[key] = value async def wait_for_service_ready(client: httpx.AsyncClient, timeout_s: float = 30.0): @@ -300,7 +255,6 @@ async def _wait_for_nudges( async def test_langflow_chat_and_nudges_endpoints(): """Exercise /langflow and /nudges endpoints against a live Langflow backend.""" required_env = ["LANGFLOW_CHAT_FLOW_ID", "NUDGES_FLOW_ID"] - _prime_langflow_env(required_env) missing = [var for var in required_env if not os.getenv(var)] assert not missing, f"Missing required Langflow configuration: {missing}"