From 9bc5964df28bc223bdcd4ddabc3817a3fcfb9a35 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Fri, 28 Aug 2026 16:58:44 +0900 Subject: [PATCH] chore: add XDG path conversion test --- tests/test_path_conversion.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tests/test_path_conversion.py diff --git a/tests/test_path_conversion.py b/tests/test_path_conversion.py new file mode 100644 index 0000000..c9b1710 --- /dev/null +++ b/tests/test_path_conversion.py @@ -0,0 +1,13 @@ +from pathlib import Path +from dzgui.config.xdg import get_xdg_paths + + +def test_path_fallback(monkeypatch) -> None: + envs = ["XDG_DATA_HOME", "XDG_STATE_HOME", "XDG_CONFIG_HOME", "XDG_CACHE_HOME"] + for env in envs: + monkeypatch.setenv(env, "/etc/dzgui") + paths = get_xdg_paths() + assert paths["XDG_CONFIG_HOME"] == Path.home().joinpath(".config/dzgui") + assert paths["XDG_STATE_HOME"] == Path.home().joinpath(".local/state/dzgui") + assert paths["XDG_DATA_HOME"] == Path.home().joinpath(".local/share/dzgui") + assert paths["XDG_CACHE_HOME"] == Path.home().joinpath(".cache/dzgui")