Skip to content

Hypergraph is more powerful. Transform unstructured text into structured knowledge with LLMs. Graphs, hypergraphs, and spatio-temporal extractions — with one command.

test: cover create() with a TemplateCfg source

dex0shubham8c223e6c9d1e
diff --git a/tests/template_engine/test_factory.py b/tests/template_engine/test_factory.py
index 1cc5d47..141b0bd 100644
--- a/tests/template_engine/test_factory.py
+++ b/tests/template_engine/test_factory.py
@@ -47,6 +47,16 @@ class TestTemplateFactoryCreateMethod:
embedder=embedder,
)
+ def test_create_from_templatecfg_instance(self, llm_client, embedder):
+ """create() accepts a TemplateCfg instance (documented + typed source)."""
+ cfg = Gallery.get("general/model")
+
+ result = TemplateFactory.create(cfg, "en", llm_client, embedder)
+
+ assert result is not None
+ assert result.metadata["template"] == cfg.name
+ assert result.metadata["lang"] == "en"
+
def test_create_method_template(self, llm_client, embedder):
"""Test creating a method template."""
result = TemplateFactory.create(