534bb94eea
Test Migrations / Migrations (SQLite) (push) Has been cancelled
Build Dev Image / build-dev-image (push) Has been cancelled
Check i18n Keys / Check i18n Key Consistency (push) Has been cancelled
Lint / Ruff Lint & Format (push) Has been cancelled
Lint / Frontend Lint (push) Has been cancelled
Test Migrations / Migrations (PostgreSQL) (push) Has been cancelled
24 lines
726 B
Python
24 lines
726 B
Python
from pathlib import Path
|
|
|
|
from langbot.pkg.utils import paths
|
|
|
|
|
|
def test_get_data_root_uses_source_root_in_repo_checkout():
|
|
data_root = Path(paths.get_data_root())
|
|
repo_root = Path(__file__).resolve().parents[2]
|
|
|
|
assert data_root == repo_root / 'data'
|
|
|
|
|
|
def test_get_data_path_joins_under_data_root():
|
|
data_path = Path(paths.get_data_path('skills', 'demo-skill'))
|
|
repo_root = Path(__file__).resolve().parents[2]
|
|
|
|
assert data_path == repo_root / 'data' / 'skills' / 'demo-skill'
|
|
|
|
|
|
def test_get_data_root_honors_env_override(monkeypatch, tmp_path):
|
|
monkeypatch.setenv('LANGBOT_DATA_ROOT', str(tmp_path / 'custom-data'))
|
|
|
|
assert Path(paths.get_data_root()) == (tmp_path / 'custom-data').resolve()
|