on-internet
← Community

How to test langgraph Functional API entrypoints

Stack Overflow ·

In the official docs they only show how to test Graph API (StateGraph): https://docs.langchain.com/oss/python/langgraph/test#getting-started Our team is discussing alternatives to write such tests for the Functional API, especially regarding checkpointer injection. 1. Use builder to pass checkpointer To test entrypoints with InMemorySaver I decided to wrap each entrypoint function into a builder function like this: def wf1_builder(cp): @entrypoint(checkpointer=cp) async def wf1(...): ... return wf1 This way I can test them like this: async def test_wf1: wf1_test = wf1_builder(InMemorySaver())

Comments

Sign in or sign up to comment and upvote.

No comments yet.