Files
bak-and-rest/tests/test_paths.py

24 lines
656 B
Python

from __future__ import annotations
from pathlib import Path
from bakrest.paths import expand_path
def test_expand_path_uses_target_user_for_userprofile() -> None:
assert expand_path("%USERPROFILE%\\Documents", "pettirosso") == Path(
"C:/Users/pettirosso/Documents"
)
def test_expand_path_uses_target_user_for_appdata() -> None:
assert expand_path("%APPDATA%\\Microsoft", ".\\pettirosso") == Path(
"C:/Users/pettirosso/AppData/Roaming/Microsoft"
)
def test_expand_path_uses_target_user_for_temp() -> None:
assert expand_path("%TEMP%", "pettirosso") == Path(
"C:/Users/pettirosso/AppData/Local/Temp"
)