def test_multiple_backlinks(tmp_path: Path):
    """
    Test a scenario with multiple notes linking to a single note.

    Create three files:
      - A.md: links to B and C.
      - B.md: links to C.
      - C.md: contains no wikilinks.

    Expected behavior:
      - Note A should have no backlinks.
      - Note B should have a backlink from A.
      - Note C should have backlinks from both A and B.
    """
    create_markdown_file(tmp_path, "A.md", "Linking to [[B]] and [[C]].")
    create_markdown_file(tmp_path, "B.md", "Linking to [[C]].")
    create_markdown_file(tmp_path, "C.md", "No links here.")

    reader = ObsidianReader(input_dir=str(tmp_path))
    docs = reader.load_data()

    doc_a = get_doc_by_note_name(docs, "A")
    doc_b = get_doc_by_note_name(docs, "B")
    doc_c = get_doc_by_note_name(docs, "C")

    # Verify note A has no backlinks.
    assert doc_a is not None
    assert doc_a.metadata.get("backlinks") == []

    # Verify note B has a backlink from A.
    assert doc_b is not None
    assert doc_b.metadata.get("backlinks") == ["A"]

    # Note C should have backlinks from A and B.
    # Since file processing order might vary, we compare as sets.
    assert doc_c is not None
    backlinks_c = doc_c.metadata.get("backlinks")
    assert set(backlinks_c) == {"A", "B"}

    Test a scenario with multiple notes linking to a single note.

    Create three files:
      - A.md: links to B and C.
      - B.md: links to C.
      - C.md: contains no wikilinks.

    Expected behavior:
      - Note A should have no backlinks.
      - Note B should have a backlink from A.
      - Note C should have backlinks from both A and B.
    
llama-index-integrations/readers/llama-index-readers-obsidian/tests/test_readers_obsidian.py