feat: Add unit tests for run_flow_from_json with fake environment variables (#4015)
* Add tests for run_flow_from_json with fake environment variables - Implemented test_run_flow_with_fake_env to validate flow execution with a fake .env file. - Added test_run_flow_with_fake_env_TWEAKS to check flow execution using environment variables loaded from the fake .env file. * Replace keys in tweaks with their corresponding environment variable values - Implemented a function to recursively replace keys in the tweaks dictionary with values from the provided environment variables. * updated to use better way to load test json file * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes * refactor: improve test readability and consistency in load tests - Renamed variable `TWEAKS` to `tweaks_dict` for clarity and consistency across tests. - Updated test function names to follow a consistent naming convention. - Enhanced comments for better understanding of test intentions. - Minor formatting adjustments to improve code readability. * feat: add aload_flow_from_json and arun_flow_from_json to module exports * fix: correct file path handling in aload_flow_from_json function * fix: improve environment variable handling in aload_flow_from_json function --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
This commit is contained in:
parent
e26b411f60
commit
0514d11d9c
6 changed files with 91 additions and 10 deletions
|
|
@ -103,6 +103,7 @@ def pytest_configure(config):
|
|||
pytest.VECTOR_STORE_PATH = data_path / "Vector_store.json"
|
||||
pytest.SIMPLE_API_TEST = data_path / "SimpleAPITest.json"
|
||||
pytest.MEMORY_CHATBOT_NO_LLM = data_path / "MemoryChatbotNoLLM.json"
|
||||
pytest.ENV_VARIABLE_TEST = data_path / "env_variable_test.json"
|
||||
pytest.LOOP_TEST = data_path / "LoopTest.json"
|
||||
pytest.CODE_WITH_SYNTAX_ERROR = """
|
||||
def get_text():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue