testhelpers

package
v1.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUserToChannel

func AddUserToChannel(t *testing.T, client *model.Client4, channelID, userID string)

AddUserToChannel adds a user to a channel

func AddUserToTeam

func AddUserToTeam(t *testing.T, client *model.Client4, teamID, userID string)

AddUserToTeam adds a user to a team

func CreateTestChannel

func CreateTestChannel(t *testing.T, client *model.Client4, teamID, name, displayName string) *model.Channel

CreateTestChannel creates a test channel

func CreateTestMCPSession

func CreateTestMCPSession(t *testing.T, mcpServer *mcp.Server) *mcp.ClientSession

CreateTestMCPSession creates an in-memory MCP client session connected to the server This enables testing tools through the full MCP protocol stack without external transports

func CreateTestPost

func CreateTestPost(t *testing.T, client *model.Client4, channelID, message string) *model.Post

CreateTestPost creates a test post

func CreateTestTeam

func CreateTestTeam(t *testing.T, client *model.Client4, name, displayName string) *model.Team

CreateTestTeam creates a test team

func CreateTestUser

func CreateTestUser(t *testing.T, client *model.Client4, username, email, password string) *model.User

CreateTestUser creates a test user

func ExecuteMCPTool

func ExecuteMCPTool(t *testing.T, mcpServer *mcp.Server, toolName string, args map[string]interface{}) (*mcp.CallToolResult, error)

ExecuteMCPTool calls an MCP tool through a test client session This provides true integration testing by using the actual MCP protocol with in-memory transport

Types

type TestData

type TestData struct {
	Team     *model.Team
	Channel  *model.Channel
	User     *model.User
	AdminPAT string
}

TestData holds common test data structures

func SetupBasicTestData

func SetupBasicTestData(t *testing.T, client *model.Client4, adminPAT string) *TestData

SetupBasicTestData creates basic test data (team, channel, user)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL