integrationtest

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserName       = "user"
	UserPassword   = "superstronguser"
	AdminName      = "admin"
	AdminPassword  = "superstrongadmin"
	TesterName     = "tester"
	TesterPassword = "superstrongtester"
)

Variables

View Source
var (
	UserToken   = ""
	AdminToken  = ""
	TesterToken = ""
)

Functions

func AddMetadataKey

func AddMetadataKey(t *testing.T, client *httpClient, key string, comment string, wantHttpStatus int) *models.MetadataKey

func AddMetadataValue

func AddMetadataValue(t *testing.T, client *httpClient, keyId int, value *models.MetadataValue, wantHttpStatus int) *models.MetadataValue

func DeleteMetadataKey

func DeleteMetadataKey(t *testing.T, client *httpClient, wantHttpStatus int, keyId int)

func DeleteTokenFile

func DeleteTokenFile() error

func DoAdminLogin

func DoAdminLogin(t *testing.T)

func DoTesterLogin added in v0.6.0

func DoTesterLogin(t *testing.T)

func DoUserLogin

func DoUserLogin(t *testing.T)

func EnsureUserLoggedIn

func EnsureUserLoggedIn(t *testing.T)

func GetDb

func GetDb() *storage.Database

func GetMetadataKey

func GetMetadataKey(t *testing.T, client *httpClient, keyId int, wantHttpStatus int) *models.MetadataKey

func GetMetadataKeys

func GetMetadataKeys(t *testing.T, client *httpClient, wantHttpStatus int, editFunc func(request *httpRequest) *httpRequest) *[]models.MetadataKey

func LoginRequest

func LoginRequest(t *testing.T, userName, password string, wantCode int) (string, int)

func ReadTokenFromFile

func ReadTokenFromFile() error

func SaveTokenToFile

func SaveTokenToFile() error

func UpdateMetadataKey

func UpdateMetadataKey(t *testing.T, client *httpClient, wantHttpStatus int, key *models.MetadataKey)

Types

type ApiTestSuite

type ApiTestSuite struct {
	suite.Suite
	// contains filtered or unexported fields
}

func (*ApiTestSuite) Init

func (suite *ApiTestSuite) Init()

func (*ApiTestSuite) SetupSuite

func (suite *ApiTestSuite) SetupSuite()

func (*ApiTestSuite) SetupTest

func (suite *ApiTestSuite) SetupTest()

func (*ApiTestSuite) TearDownSuite

func (suite *ApiTestSuite) TearDownSuite()

Jump to

Keyboard shortcuts

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