feat(infra): auto-commit con 88 cambios
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
"""Tests para extract_obsidian_wikilinks."""
|
||||
|
||||
from extract_obsidian_wikilinks import extract_obsidian_wikilinks
|
||||
|
||||
|
||||
def test_links_basicos_y_normalizacion():
|
||||
body = (
|
||||
"See [[Note A]] and [[Note B|the second]] plus [[Note A#Section]] "
|
||||
"and [[Note C#^block123]]."
|
||||
)
|
||||
links = extract_obsidian_wikilinks(body)
|
||||
assert links == ["Note A", "Note B", "Note C"]
|
||||
|
||||
|
||||
def test_incluye_embeds():
|
||||
body = "Text [[Note A]] and embed ![[diagram.png]] and ![[Note D]]."
|
||||
links = extract_obsidian_wikilinks(body)
|
||||
assert links == ["Note A", "diagram.png", "Note D"]
|
||||
|
||||
|
||||
def test_dedup_preserva_orden():
|
||||
body = "[[Z]] [[A]] [[Z]] [[A|alias]] [[B]]"
|
||||
links = extract_obsidian_wikilinks(body)
|
||||
assert links == ["Z", "A", "B"]
|
||||
|
||||
|
||||
def test_alias_y_heading_combinados():
|
||||
body = "[[Note E#Heading|Custom Alias]]"
|
||||
links = extract_obsidian_wikilinks(body)
|
||||
assert links == ["Note E"]
|
||||
|
||||
|
||||
def test_whitespace_se_strippa():
|
||||
body = "[[ spaced note |alias]] and [[ tight ]]"
|
||||
links = extract_obsidian_wikilinks(body)
|
||||
assert links == ["spaced note", "tight"]
|
||||
|
||||
|
||||
def test_sin_links():
|
||||
assert extract_obsidian_wikilinks("no links here") == []
|
||||
|
||||
|
||||
def test_body_vacio():
|
||||
assert extract_obsidian_wikilinks("") == []
|
||||
Reference in New Issue
Block a user