Documentation
¶
Overview ¶
Package testutils provides utility functions for testing Zulip API clients.
Index ¶
- Constants
- Variables
- func CreateDirectMessage(t *testing.T, apiClient client.Client, to int64) int64
- func CreateRandomChannel(t *testing.T, apiClient client.Client, subscribers ...int64) (string, int64)
- func CreateRandomUserGroup(t *testing.T, apiClient client.Client, members ...int64) int64
- func GetAdminClient(t *testing.T) client.Client
- func GetBotClient(t *testing.T) client.Client
- func GetChannelWithAllClients(t *testing.T) (string, int64)
- func GetFeatureLevel(t *testing.T) int
- func GetGuestClient(t *testing.T) client.Client
- func GetModeratorClient(t *testing.T) client.Client
- func GetNormalClient(t *testing.T) client.Client
- func GetOtherNormalClient(t *testing.T) client.Client
- func GetOwnerClient(t *testing.T) client.Client
- func GetTestClient(t *testing.T, username string) (*z.RC, client.Client)
- func GetUserEmail(t *testing.T, apiClient client.Client) string
- func GetUserID(t *testing.T, apiClient client.Client) int64
- func RequireFeatureLevel(t *testing.T, minLevel int)
- func RunForAdminAndOwnerClients(t *testing.T, fn func(*testing.T, client.Client))
- func RunForAllClients(t *testing.T, fn func(*testing.T, client.Client))
- func RunForClients(t *testing.T, clients []namedClient, fn func(*testing.T, client.Client))
- func SendChannelMessage(t *testing.T, apiClient client.Client, channelID int64, topic, content string) int64
- func UniqueName(prefix string) string
- func UploadFileForTest(ctx context.Context, t *testing.T, apiClient client.Client) *messages.UploadFileResponse
- type ChannelMessage
- type UserInfo
Constants ¶
View Source
const ( TestSite = "http://localhost:9991" TestOwnerUsername = "[email protected]" TestAdminUsername = "[email protected]" TestModeratorUsername = "[email protected]" TestGuestUsername = "[email protected]" TestNormalUsername = "[email protected]" OtherNormalUsername = "[email protected]" DeactivateTestUser = "[email protected]" )
Constants for test users.
Variables ¶
View Source
var ( OwnerClient = namedClient{/* contains filtered or unexported fields */} AdminClient = namedClient{/* contains filtered or unexported fields */} ModeratorClient = namedClient{/* contains filtered or unexported fields */} NormalClient = namedClient{/* contains filtered or unexported fields */} BotClient = namedClient{/* contains filtered or unexported fields */} AllClients = []namedClient{OwnerClient, AdminClient, ModeratorClient, NormalClient} )
named clients for testing.
Functions ¶
func CreateDirectMessage ¶
func CreateRandomChannel ¶
func CreateRandomUserGroup ¶
func GetFeatureLevel ¶
func RequireFeatureLevel ¶
func RunForClients ¶
func SendChannelMessage ¶
func UniqueName ¶
func UploadFileForTest ¶
Types ¶
type ChannelMessage ¶
func CreateChannelMessage ¶
Click to show internal directories.
Click to hide internal directories.