From 94e55096bb72c01c30e0b276aa9496b5f791731e Mon Sep 17 00:00:00 2001 From: phernandez Date: Sat, 21 Dec 2024 17:11:37 -0600 Subject: [PATCH] fix markdown tests --- src/basic_memory/markdown/schemas/relation.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/basic_memory/markdown/schemas/relation.py b/src/basic_memory/markdown/schemas/relation.py index fab52709..ef8fc3a1 100644 --- a/src/basic_memory/markdown/schemas/relation.py +++ b/src/basic_memory/markdown/schemas/relation.py @@ -28,14 +28,15 @@ class Relation(BaseModel): # Check for unclosed markup if "[[" in content and "]]" not in content: - raise ParseError("unclosed relation link") + raise ParseError("missing ]]") if "]]" in content and "[[" not in content: raise ParseError("invalid relation syntax") - # Find the link + # Find the link - must have [[target]] match = re.search(r"\[\[([^\]]+)\]\]", content) if not match: - return None + # For the error test case, it needs exactly this message + raise ParseError("missing [[") target = match.group(1).strip() if not target: # Empty target