Documentation
¶
Index ¶
- func AssertContains(t *testing.T, haystack, needle string, msgAndArgs ...interface{})
- func AssertEqual(t *testing.T, expected, actual interface{}, msgAndArgs ...interface{})
- func AssertError(t *testing.T, err error, msgAndArgs ...interface{})
- func AssertEventually(t *testing.T, condition func() bool, timeout time.Duration, ...)
- func AssertFalse(t *testing.T, value bool, msgAndArgs ...interface{})
- func AssertNil(t *testing.T, value interface{}, msgAndArgs ...interface{})
- func AssertNoError(t *testing.T, err error, msgAndArgs ...interface{})
- func AssertNotNil(t *testing.T, value interface{}, msgAndArgs ...interface{})
- func AssertTrue(t *testing.T, value bool, msgAndArgs ...interface{})
- func RunParallel(t *testing.T, tests map[string]func(t *testing.T))
- func WaitForCondition(ctx context.Context, condition func() bool, interval time.Duration) error
- type TestAgentConfig
- type TestAppContext
- type TestContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertContains ¶
AssertContains asserts that a string contains a substring
func AssertEqual ¶
AssertEqual asserts that two values are equal
func AssertError ¶
AssertError asserts that an error is not nil
func AssertEventually ¶
func AssertEventually(t *testing.T, condition func() bool, timeout time.Duration, msgAndArgs ...interface{})
AssertEventually asserts that a condition is eventually true
func AssertFalse ¶
AssertFalse asserts that a value is false
func AssertNoError ¶
AssertNoError asserts that an error is nil
func AssertNotNil ¶
AssertNotNil asserts that a value is not nil
func AssertTrue ¶
AssertTrue asserts that a value is true
func RunParallel ¶
RunParallel runs test functions in parallel
Types ¶
type TestAgentConfig ¶
CreateTestAgent creates a test agent with mocks
func DefaultTestAgentConfig ¶
func DefaultTestAgentConfig() TestAgentConfig
DefaultTestAgentConfig returns default test agent config
type TestAppContext ¶
TestAppContext is a simple application context for testing
type TestContext ¶
type TestContext struct {
Ctx context.Context
Cancel context.CancelFunc
State *state.AgentState
Store store.Store
Checkpointer checkpoint.Checkpointer
MockLLM *mocks.MockLLMClient
MockTools map[string]*mocks.MockTool
T *testing.T
}
TestContext provides a complete test environment
func NewTestContext ¶
func NewTestContext(t *testing.T) *TestContext
NewTestContext creates a new test context
func (*TestContext) AddMockTool ¶
func (tc *TestContext) AddMockTool(name, description string) *mocks.MockTool
AddMockTool adds a mock tool to the context
func (*TestContext) CreateRuntime ¶
func (tc *TestContext) CreateRuntime(sessionID string) *execution.Runtime[TestAppContext, *state.AgentState]
CreateRuntime creates a test runtime