langflow/tests/test_cli.py
Gabriel Luiz Freitas Almeida 4e1fc2202a 🔥 refactor(test_cli.py): remove unused imports and test cases
The test_cli.py file had some unused imports and test cases that were not being used. This commit removes those unused imports and test cases to improve code cleanliness and maintainability.
2023-08-07 14:16:37 -03:00

30 lines
790 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 temp_dir in settings_manager.settings.COMPONENTS_PATH