Documentation ¶
Index ¶
- 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 LoadGitRepo ¶
LoadGitRepo load a git repo into a test context. Requires that ctx.Repo has already been populated.
func LoadRepoCommit ¶
LoadRepoCommit loads a repo's commit 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 ¶
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
Click to show internal directories.
Click to hide internal directories.