Documentation ¶
Index ¶
- func IsNormalPageCompleted(s string) bool
- func LoadGitRepo(t *testing.T, ctx *context.Context)
- func LoadRepo(t *testing.T, ctx gocontext.Context, repoID int64)
- func LoadRepoCommit(t *testing.T, ctx gocontext.Context)
- func LoadUser(t *testing.T, ctx gocontext.Context, userID int64)
- func MockAPIContext(t *testing.T, path string) *context.APIContext
- func MockContext(t *testing.T, path string) *context.Context
- func RedirectURL(resp http.ResponseWriter) string
- type LogChecker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNormalPageCompleted ¶ added in v1.20.0
func LoadGitRepo ¶ added in v1.4.0
LoadGitRepo load a git repo into a test context. Requires that ctx.Repo has already been populated.
func LoadRepoCommit ¶ added in v1.5.0
LoadRepoCommit loads a repo's commit 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 ¶
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
Click to show internal directories.
Click to hide internal directories.