.........FFFFF..........                                                 [100%]
=================================== FAILURES ===================================
________ TestCollectionRealDatabase.test_ls_subpath_is_segment_aligned _________

self = <tests.unit.cli.test_collection.TestCollectionRealDatabase object at 0x1246c36b0>
tmp_path = PosixPath('/private/var/folders/1q/2qhztsp1673fnqgrpblxnpd40000gn/T/pytest-of-forrest/pytest-320/test_ls_subpath_is_segment_ali0')
sibling_notes_dir = PosixPath('/private/var/folders/1q/2qhztsp1673fnqgrpblxnpd40000gn/T/pytest-of-forrest/pytest-320/test_ls_subpath_is_segment_ali0/notes')

    def test_ls_subpath_is_segment_aligned(
        self, tmp_path: Path, sibling_notes_dir: Path
    ) -> None:
        """WR-05: a relative subpath lists its own subtree, never a sibling prefix."""
        db_path = tmp_path / "sif.db"
        self._seed(db_path, "notes", sibling_notes_dir)
    
        filtered = self._invoke(db_path, "ls", "notes", "python")
        unfiltered = self._invoke(db_path, "ls", "notes")
    
        assert filtered.exit_code == 0, filtered.output
        assert "python/a.md" in filtered.output
>       assert "b.md" not in filtered.output
E       AssertionError: assert 'b.md' not in 'notes\n├── ...thon2/b.md\n'
E         
E         'b.md' is contained here:
E           notes
E           ├── python/a.md
E           └── python2/b.md
E         ?             ++++

tests/unit/cli/test_collection.py:245: AssertionError
____ TestCollectionRealDatabase.test_ls_subpath_absolute_is_segment_aligned ____

self = <tests.unit.cli.test_collection.TestCollectionRealDatabase object at 0x14a29f980>
tmp_path = PosixPath('/private/var/folders/1q/2qhztsp1673fnqgrpblxnpd40000gn/T/pytest-of-forrest/pytest-320/test_ls_subpath_absolute_is_se0')
sibling_notes_dir = PosixPath('/private/var/folders/1q/2qhztsp1673fnqgrpblxnpd40000gn/T/pytest-of-forrest/pytest-320/test_ls_subpath_absolute_is_se0/notes')

    def test_ls_subpath_absolute_is_segment_aligned(
        self, tmp_path: Path, sibling_notes_dir: Path
    ) -> None:
        """An absolute subpath selects the same subtree as the relative form."""
        db_path = tmp_path / "sif.db"
        self._seed(db_path, "notes", sibling_notes_dir)
    
        result = self._invoke(db_path, "ls", "notes", str(sibling_notes_dir / "python"))
    
        assert result.exit_code == 0, result.output
        assert "python/a.md" in result.output
>       assert "b.md" not in result.output
E       AssertionError: assert 'b.md' not in 'notes\n├── ...thon2/b.md\n'
E         
E         'b.md' is contained here:
E           notes
E           ├── python/a.md
E           └── python2/b.md
E         ?             ++++

tests/unit/cli/test_collection.py:261: AssertionError
____________ TestCollectionRealDatabase.test_ls_subpath_exact_file _____________

self = <tests.unit.cli.test_collection.TestCollectionRealDatabase object at 0x14a32fcb0>
tmp_path = PosixPath('/private/var/folders/1q/2qhztsp1673fnqgrpblxnpd40000gn/T/pytest-of-forrest/pytest-320/test_ls_subpath_exact_file0')
sibling_notes_dir = PosixPath('/private/var/folders/1q/2qhztsp1673fnqgrpblxnpd40000gn/T/pytest-of-forrest/pytest-320/test_ls_subpath_exact_file0/notes')

    def test_ls_subpath_exact_file(self, tmp_path: Path, sibling_notes_dir: Path) -> None:
        """An exact-file subpath selects that single file."""
        db_path = tmp_path / "sif.db"
        self._seed(db_path, "notes", sibling_notes_dir)
    
        result = self._invoke(db_path, "ls", "notes", "python/a.md")
    
        assert result.exit_code == 0, result.output
        assert "python/a.md" in result.output
>       assert "b.md" not in result.output
E       AssertionError: assert 'b.md' not in 'notes\n├── ...thon2/b.md\n'
E         
E         'b.md' is contained here:
E           notes
E           ├── python/a.md
E           └── python2/b.md
E         ?             ++++

tests/unit/cli/test_collection.py:272: AssertionError
__________ TestCollectionRealDatabase.test_ls_subpath_trailing_slash ___________

self = <tests.unit.cli.test_collection.TestCollectionRealDatabase object at 0x14a38c210>
tmp_path = PosixPath('/private/var/folders/1q/2qhztsp1673fnqgrpblxnpd40000gn/T/pytest-of-forrest/pytest-320/test_ls_subpath_trailing_slash0')
sibling_notes_dir = PosixPath('/private/var/folders/1q/2qhztsp1673fnqgrpblxnpd40000gn/T/pytest-of-forrest/pytest-320/test_ls_subpath_trailing_slash0/notes')

    def test_ls_subpath_trailing_slash(self, tmp_path: Path, sibling_notes_dir: Path) -> None:
        """A trailing-slash subpath selects the same file as the bare form."""
        db_path = tmp_path / "sif.db"
        self._seed(db_path, "notes", sibling_notes_dir)
    
        result = self._invoke(db_path, "ls", "notes", "python/")
    
        assert result.exit_code == 0, result.output
        assert "python/a.md" in result.output
>       assert "b.md" not in result.output
E       AssertionError: assert 'b.md' not in 'notes\n├── ...thon2/b.md\n'
E         
E         'b.md' is contained here:
E           notes
E           ├── python/a.md
E           └── python2/b.md
E         ?             ++++

tests/unit/cli/test_collection.py:283: AssertionError
_____ TestCollectionRealDatabase.test_ls_subpath_no_match_reports_no_files _____

self = <tests.unit.cli.test_collection.TestCollectionRealDatabase object at 0x14a33ad00>
tmp_path = PosixPath('/private/var/folders/1q/2qhztsp1673fnqgrpblxnpd40000gn/T/pytest-of-forrest/pytest-320/test_ls_subpath_no_match_repor0')
sibling_notes_dir = PosixPath('/private/var/folders/1q/2qhztsp1673fnqgrpblxnpd40000gn/T/pytest-of-forrest/pytest-320/test_ls_subpath_no_match_repor0/notes')

    def test_ls_subpath_no_match_reports_no_files(
        self, tmp_path: Path, sibling_notes_dir: Path
    ) -> None:
        """A subpath matching nothing exits 0 with the existing no-files message."""
        db_path = tmp_path / "sif.db"
        self._seed(db_path, "notes", sibling_notes_dir)
    
        result = self._invoke(db_path, "ls", "notes", "missing")
    
        assert result.exit_code == 0, result.output
>       assert "No files found in collection." in result.output
E       AssertionError: assert 'No files found in collection.' in 'notes\n├── python/a.md\n└── python2/b.md\n'
E        +  where 'notes\n├── python/a.md\n└── python2/b.md\n' = <Result okay>.output

tests/unit/cli/test_collection.py:295: AssertionError
=========================== short test summary info ============================
FAILED tests/unit/cli/test_collection.py::TestCollectionRealDatabase::test_ls_subpath_is_segment_aligned
FAILED tests/unit/cli/test_collection.py::TestCollectionRealDatabase::test_ls_subpath_absolute_is_segment_aligned
FAILED tests/unit/cli/test_collection.py::TestCollectionRealDatabase::test_ls_subpath_exact_file
FAILED tests/unit/cli/test_collection.py::TestCollectionRealDatabase::test_ls_subpath_trailing_slash
FAILED tests/unit/cli/test_collection.py::TestCollectionRealDatabase::test_ls_subpath_no_match_reports_no_files
5 failed, 19 passed in 1.55s
