from flowcraft.engine import run_workflow def test_llm_mock(): logs = run_workflow({"nodes": [{"id":"1","type":"llm","data":{"prompt":"hi"}}]}) assert logs[0]["type"]=="llm" and "mock-llm" in logs[0]["output"]["response"] def test_sequence(): logs = run_workflow({"nodes": [{"id":"1","type":"trigger"},{"id":"2","type":"llm","data":{"prompt":"summarize"}},{"id":"3","type":"human"}]}) assert len(logs)==3 def test_condition(): logs = run_workflow({"nodes": [{"id":"1","type":"condition","data":{"expr":"inputs['x']==1"}}]}, inputs={"x":1}) assert logs[0]["output"]["result"]==True