Private
Public Access
0
0
Files
manual_slop/tests/test_live_gui_workspace_fixture.py
T

32 lines
1.2 KiB
Python

"""Tests for the live_gui_workspace fixture (Phase 3, Task 3.2)."""
from pathlib import Path
def test_live_gui_workspace_is_path(live_gui_workspace) -> None:
"""The live_gui_workspace fixture yields a Path object."""
assert isinstance(live_gui_workspace, Path)
def test_live_gui_workspace_exists(live_gui_workspace) -> None:
"""The workspace path was created and exists on disk."""
assert live_gui_workspace.exists()
def test_live_gui_workspace_is_a_directory(live_gui_workspace) -> None:
"""The workspace is a directory (not a file)."""
assert live_gui_workspace.is_dir()
def test_live_gui_workspace_in_tmp_dir(live_gui_workspace) -> None:
"""The workspace is in pytest's tmp dir, NOT in the project tree."""
# Should be under the system temp dir (e.g. AppData/Local/Temp on Windows)
path_str = str(live_gui_workspace).lower()
assert 'temp' in path_str or 'tmp' in path_str, f"Workspace not in tmp dir: {live_gui_workspace}"
def test_live_gui_workspace_writable(live_gui_workspace) -> None:
"""Tests can write to the workspace."""
test_file = live_gui_workspace / "test_write.txt"
test_file.write_text("hello", encoding="utf-8")
assert test_file.read_text(encoding="utf-8") == "hello"