release: 0.2.6 add advanced navigation and contextual open actions
This commit is contained in:
@@ -2,7 +2,13 @@ from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from app.filesystem import DirectoryEntry, has_subdirectories, list_directories
|
||||
from app.filesystem import (
|
||||
DirectoryEntry,
|
||||
FileSystemEntry,
|
||||
has_subdirectories,
|
||||
list_directories,
|
||||
list_entries,
|
||||
)
|
||||
|
||||
|
||||
def test_has_subdirectories_detects_nested_directory(tmp_path: Path) -> None:
|
||||
@@ -46,6 +52,28 @@ def test_list_directories_raises_for_missing_directory(tmp_path: Path) -> None:
|
||||
list_directories(missing_path)
|
||||
|
||||
|
||||
def test_list_entries_returns_files_when_include_files_enabled(tmp_path: Path) -> None:
|
||||
folder = tmp_path / "folder"
|
||||
file_path = tmp_path / "notes.txt"
|
||||
folder.mkdir()
|
||||
file_path.write_text("content", encoding="utf-8")
|
||||
|
||||
assert list_entries(tmp_path, include_files=True) == [
|
||||
FileSystemEntry(
|
||||
name="folder",
|
||||
path=folder,
|
||||
is_directory=True,
|
||||
has_children=False,
|
||||
),
|
||||
FileSystemEntry(
|
||||
name="notes.txt",
|
||||
path=file_path,
|
||||
is_directory=False,
|
||||
has_children=False,
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
def test_list_directories_skips_permission_errors_for_children(tmp_path: Path) -> None:
|
||||
root = tmp_path / "root"
|
||||
root.mkdir()
|
||||
|
||||
Reference in New Issue
Block a user