mirror of
https://github.com/19JVJeffery/tiddl-gui.git
synced 2026-10-21 10:29:45 -05:00
Agent-Logs-Url: https://github.com/19JVJeffery/tiddl-gui/sessions/ee218a96-15f4-4124-8eea-902561b3cc4e Co-authored-by: 19JVJeffery <94115228+19JVJeffery@users.noreply.github.com>
21 lines
585 B
Python
21 lines
585 B
Python
import pytest
|
|
from pathlib import Path
|
|
|
|
from tiddl.cli.const import get_app_path, APP_DIR_NAME, ENV_KEY
|
|
|
|
|
|
def test_env_key_overrides(monkeypatch: pytest.MonkeyPatch, tmp_path: Path):
|
|
custom_path = tmp_path / "customdir"
|
|
monkeypatch.setenv(ENV_KEY, str(custom_path))
|
|
app_path = get_app_path(ENV_KEY)
|
|
|
|
assert app_path == custom_path
|
|
|
|
|
|
def test_default_path_if_unset(monkeypatch: pytest.MonkeyPatch):
|
|
monkeypatch.delenv(ENV_KEY, raising=False)
|
|
app_path = get_app_path(ENV_KEY)
|
|
|
|
assert str(Path.home()) in str(app_path)
|
|
assert app_path.name == APP_DIR_NAME
|