test

package
v0.19.4 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadGitRepo

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

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

LoadRepo load a repo into a test context.

func LoadRepoCommit

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

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

func LoadUser

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

LoadUser load a user into a test context.

func MockAPIContext

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

func RedirectURL(resp http.ResponseWriter) string

RedirectURL returns the redirect URL of a http response.

Types

type LogChecker

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

func NewLogChecker

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

func (*LogChecker) Check

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

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

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

func (*LogChecker) Run

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

func (*LogChecker) StopMark

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