test

package
v1.21.0-dev Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNormalPageCompleted added in v1.20.0

func IsNormalPageCompleted(s string) bool

func LoadGitRepo added in v1.4.0

func LoadGitRepo(t *testing.T, ctx *context.Context)

LoadGitRepo load a git repo into a test context. Requires that ctx.Repo has already been populated.

func LoadRepo added in v1.4.0

func LoadRepo(t *testing.T, ctx gocontext.Context, repoID int64)

LoadRepo load a repo into a test context.

func LoadRepoCommit added in v1.5.0

func LoadRepoCommit(t *testing.T, ctx gocontext.Context)

LoadRepoCommit loads a repo's commit into a test context.

func LoadUser added in v1.4.0

func LoadUser(t *testing.T, ctx gocontext.Context, userID int64)

LoadUser load a user into a test context.

func MockAPIContext added in v1.20.0

func MockAPIContext(t *testing.T, path string) *context.APIContext

MockAPIContext mock context for unit tests TODO: move this function to other packages, because it depends on "models" package

func MockContext

func MockContext(t *testing.T, path string) *context.Context

MockContext mock context for unit tests TODO: move this function to other packages, because it depends on "models" package

func RedirectURL added in v1.4.0

func RedirectURL(resp http.ResponseWriter) string

RedirectURL returns the redirect URL of a http response.

Types

type LogChecker added in v1.20.0

type LogChecker struct {
	*log.EventWriterBaseImpl
	// contains filtered or unexported fields
}

func NewLogChecker added in v1.20.0

func NewLogChecker(namePrefix string) (logChecker *LogChecker, cancel func())

func (*LogChecker) Check added in v1.20.0

func (lc *LogChecker) Check(d time.Duration) (filtered []bool, stopped bool)

Check returns the filtered slice and whether the stop mark is reached.

func (*LogChecker) Filter added in v1.20.0

func (lc *LogChecker) Filter(msgs ...string) *LogChecker

Filter will make the `Check` function to check if these logs are outputted.

func (*LogChecker) Run added in v1.20.0

func (lc *LogChecker) Run(ctx context.Context)

func (*LogChecker) StopMark added in v1.20.0

func (lc *LogChecker) StopMark(msg string) *LogChecker

Jump to

Keyboard shortcuts

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