def test_file_metadata_nested(tmp_path: Path):
    """
    Test that a markdown file in a subdirectory gets the correct folder path metadata.
    """
    subdir = tmp_path / "subfolder"
    subdir.mkdir()
    content = "Nested file content."
    create_markdown_file(subdir, "nested.md", content)

    reader = ObsidianReader(input_dir=str(tmp_path))
    docs = reader.load_data()
    # Expect one document loaded from the nested directory
    assert len(docs) == 1
    doc = docs[0]
    assert doc.metadata.get("file_name") == "nested.md"
    assert Path(doc.metadata.get("folder_path")).resolve() == subdir.resolve()

    Test that a markdown file in a subdirectory gets the correct folder path metadata.
    
llama-index-integrations/readers/llama-index-readers-obsidian/tests/test_readers_obsidian.py