🐛 fix(test_cache.py): fix clear_cache function call by passing session_id parameter 🐛 fix(test_cache_manager.py): import CacheManager from langflow.services.chat.cache module instead of langflow.services.cache.manager 🐛 fix(test_cli.py): convert temp_dir to string before checking if it is in COMPONENTS_PATH 🐛 fix(test_process.py): fix clear_cache function call by passing session_id parameter
30 lines
795 B
Python
30 lines
795 B
Python
from pathlib import Path
|
|
from tempfile import tempdir
|
|
from langflow.__main__ import app
|
|
import pytest
|
|
|
|
from langflow.services import utils
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
|
def default_settings():
|
|
return [
|
|
"--backend-only",
|
|
"--no-open-browser",
|
|
]
|
|
|
|
|
|
def test_components_path(runner, client, default_settings):
|
|
# Create a foldr in the tmp directory
|
|
temp_dir = Path(tempdir)
|
|
# create a "components" folder
|
|
temp_dir = temp_dir / "components"
|
|
temp_dir.mkdir(exist_ok=True)
|
|
|
|
result = runner.invoke(
|
|
app,
|
|
["--components-path", str(temp_dir), *default_settings],
|
|
)
|
|
assert result.exit_code == 0, result.stdout
|
|
settings_manager = utils.get_settings_manager()
|
|
assert str(temp_dir) in settings_manager.settings.COMPONENTS_PATH
|