Add unit test for original format example in test_callout_edges.py: Validate extraction of related_to and derived_from edges from a specified text format, ensuring accurate parsing and edge recognition.
All checks were successful
Deploy mindnet to llm-node / deploy (push) Successful in 3s

This commit is contained in:
Lars 2026-01-06 10:23:56 +01:00
parent 8ed4efaadc
commit 4a404d74de

View File

@ -138,6 +138,34 @@ class TestCalloutEdges(unittest.TestCase):
self.assertIn(("related_to", "Target#Section1"), pairs)
self.assertIn(("related_to", "Target#Section2"), pairs)
def test_original_format_example(self):
"""Test: Das ursprünglich gefragte Format aus der Roadmap."""
text = """> [!abstract]- 🕸️ Semantic Mapping
>> [!edge] related_to
>> [[Brigitte]]
>> [[Klaus]]
>> [[Salami Fertigpizza]]
>
>> [!edge] derived_from
>> [[Link 2]]"""
pairs, remaining = extract_callout_relations(text)
# Prüfe, dass alle Edges erkannt wurden
self.assertEqual(len(pairs), 4)
# Prüfe related_to Edges
related_pairs = [p for p in pairs if p[0] == "related_to"]
self.assertEqual(len(related_pairs), 3)
self.assertIn(("related_to", "Brigitte"), pairs)
self.assertIn(("related_to", "Klaus"), pairs)
self.assertIn(("related_to", "Salami Fertigpizza"), pairs)
# Prüfe derived_from Edge
derived_pairs = [p for p in pairs if p[0] == "derived_from"]
self.assertEqual(len(derived_pairs), 1)
self.assertIn(("derived_from", "Link 2"), pairs)
if __name__ == "__main__":
unittest.main()