mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-14 18:18:08 +00:00
fix: minor parser and id hardening
This commit is contained in:
1 parent
223a7588aa
commit
9f19bc64b5
14 files changed
+308
-20
No files matched your search
@@ -234,6 +234,29 @@ class TestExecuteStateNode:
|
||||
assert "result" not in engine.state
|
||||
|
||||
|
||||
class TestEndNodeSeparator:
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_separates_from_prior_streamed_output(self):
|
||||
# A prior streaming node ran, so the end template must be preceded by a
|
||||
# paragraph break instead of mashing ("...growth.Sales analysis...").
|
||||
node = _make_node("n1", NodeType.END, config={"config": {"output_template": "Final line."}})
|
||||
engine = WorkflowEngine(_make_graph([node], []), _make_agent())
|
||||
engine.state = {}
|
||||
engine._has_streamed = True
|
||||
answers = [e["answer"] for e in engine._execute_end_node(node)]
|
||||
assert answers[0] == "\n\n"
|
||||
assert answers[-1].strip() == "Final line."
|
||||
|
||||
@pytest.mark.unit
|
||||
def test_no_separator_when_nothing_streamed(self):
|
||||
node = _make_node("n1", NodeType.END, config={"config": {"output_template": "Final line."}})
|
||||
engine = WorkflowEngine(_make_graph([node], []), _make_agent())
|
||||
engine.state = {}
|
||||
answers = [e["answer"] for e in engine._execute_end_node(node)]
|
||||
assert answers == ["Final line."]
|
||||
|
||||
|
||||
class TestExecuteConditionNode:
|
||||
|
||||
@pytest.mark.unit
|
||||
|
||||
Reference in new issue
Block a user