testutils

package
v0.1.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

go:build test

Index

Constants

This section is empty.

Variables

View Source
var ModuleModels []*models.Module = declaredModules
View Source
var OrgAdditionalMembers []*models.OrganizationMember = declaredOrgAdditionalMembers
View Source
var OrgInviteLinks []*models.OrganizationInviteLink = declaredOrgInviteLinks
View Source
var OrgInviteLinksUnencryptedTok map[string]string = make(map[string]string)
View Source
var OrgModels []*models.Organization = declaredOrgModels
View Source
var PATModels []*models.PersonalAccessToken = declaredPATModels
View Source
var TeamModels []*models.Team = declaredTeamModels
View Source
var UserModels []*models.User = declaredUserModels
View Source
var UserSessionModels []*models.UserSession = declaredUserSessionModels

UserSessionModels do not represent actually valid user sessions

Functions

func AssertBaseEqual

func AssertBaseEqual(t *testing.T, base1, base2 *models.Base)

func AssertOrgsEqual

func AssertOrgsEqual(t *testing.T, org1, org2 *models.Organization, compareMembers, comparePolicies bool)

func AssertPATsEqual

func AssertPATsEqual(t *testing.T, pat1, pat2 *models.PersonalAccessToken)

func AssertUserSessionsEqual

func AssertUserSessionsEqual(t *testing.T, userSess1, userSess2 *models.UserSession)

func AssertUsersEqual

func AssertUsersEqual(t *testing.T, user1, user2 *models.User)

func Cleanup

func Cleanup(t *testing.T, tester *Tester)

func InitAll

func InitAll()

func InitModules

func InitModules(t *testing.T, conf *database.Config) error

Note that the declared modules are assigned to the teams in a round-robin fashion

func InitOrgAdditionalMemberAdmin

func InitOrgAdditionalMemberAdmin(t *testing.T, conf *database.Config) error

InitOrgAdditionalMemberAdmin adds additional members to the org matching the email address, adding them as new admin members. Assigned in round-robin fashion.

func InitOrgInviteLinks(t *testing.T, conf *database.Config) error

InitOrgInviteLinks generates invite links with the declared invitee email addresses

func InitOrgs

func InitOrgs(t *testing.T, conf *database.Config) error

Note that the declared orgs are assigned to the users in a round-robin fashion

func InitPATs

func InitPATs(t *testing.T, conf *database.Config) error

Note that the declared PATs are assigned to the users in a round-robin fashion

func InitTeams

func InitTeams(t *testing.T, conf *database.Config) error

Note that the declared teams are assigned to the orgs in a round-robin fashion

func InitUserSessions

func InitUserSessions(t *testing.T, conf *database.Config) error

func InitUsers

func InitUsers(t *testing.T, conf *database.Config) error

func RunTestWithDatabase

func RunTestWithDatabase(t *testing.T, test func(config *database.Config) error, initMethods ...InitDataFunc)

Types

type InitDataFunc

type InitDataFunc func(t *testing.T, conf *database.Config) error

type Tester

type Tester struct {
	// contains filtered or unexported fields
}

func NewTestEnv

func NewTestEnv(t *testing.T) *Tester

Jump to

Keyboard shortcuts

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