sharedtest

package
v0.0.0-...-081ecb4 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: AGPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FakeGithubCfg = FakeGithubServerConfig{
	AuthHandler:          authHandler,
	TokenHandler:         tokenHandler,
	ProfileHandler:       profileHandler,
	GetRepoHandler:       getRepoHandler,
	ListRepoHooksHandler: listRepoHooksHandler,
	GetBranchHandler:     getBranchHandler,
	EmailHandler:         emailHandler,
	ListReposHandler:     listReposHandler,
	AddHookHandler:       addHookHandler,
	DeleteHookHandler:    deleteHookHandler,
}

Functions

func GetActivatedRepo

func GetActivatedRepo(t *testing.T) (*Repo, *User)

func GetDeactivatedRepo

func GetDeactivatedRepo(t *testing.T) (*Repo, *User)

func SendJSON

func SendJSON(w http.ResponseWriter, obj interface{})

Types

type App

type App struct {
	// contains filtered or unexported fields
}

func GetDefaultTestApp

func GetDefaultTestApp() *App

func RunApp

func RunApp() *App

func (*App) BuildCommonDeps

func (ta *App) BuildCommonDeps() *CommonDeps

func (App) Login

func (ta App) Login(t *testing.T) *User

func (App) PurgeAnalyzesQueue

func (a App) PurgeAnalyzesQueue(t *testing.T)

type CommonDeps

type CommonDeps struct {
	DB              *gorm.DB
	Cfg             config.Config
	Log             logutil.Log
	ProviderFactory providers.Factory
}

type FakeGithubServerConfig

type FakeGithubServerConfig struct {
	AuthHandler          http.HandlerFunc
	TokenHandler         http.HandlerFunc
	ProfileHandler       http.HandlerFunc
	GetRepoHandler       http.HandlerFunc
	ListRepoHooksHandler http.HandlerFunc
	GetBranchHandler     http.HandlerFunc
	EmailHandler         http.HandlerFunc
	ListReposHandler     http.HandlerFunc
	AddHookHandler       http.HandlerFunc
	DeleteHookHandler    http.HandlerFunc
}

type Repo

type Repo struct {
	returntypes.RepoInfo
	// contains filtered or unexported fields
}

func (*Repo) Activate

func (r *Repo) Activate()

func (*Repo) ActivateFail

func (r *Repo) ActivateFail()

func (*Repo) Deactivate

func (r *Repo) Deactivate()

func (Repo) ExpectWebhook

func (r Repo) ExpectWebhook(eventType string, payload interface{}) *httpexpect.Response

type User

type User struct {
	returntypes.AuthorizedUser
	A *require.Assertions
	E *httpexpect.Expect
	// contains filtered or unexported fields
}

func Login

func Login(t *testing.T) *User

func (*User) GithubPrivateLogin

func (u *User) GithubPrivateLogin() *User

func (*User) Repos

func (u *User) Repos() []Repo

func (*User) WerePrivateReposFetched

func (u *User) WerePrivateReposFetched() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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