tests

package
v0.0.0-...-df17592 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GithubMock

type GithubMock struct {
	*PullRequestsMock
	*IssuesMock
}

func (GithubMock) Issues

func (g GithubMock) Issues() core.GhIssues

func (GithubMock) PullRequests

func (g GithubMock) PullRequests() core.GhPullRequest

type IssuesMock

type IssuesMock struct {
	mock.Mock
}

func (*IssuesMock) CallListAndReturnPr

func (m *IssuesMock) CallListAndReturnPr(prNumber int)

func (*IssuesMock) CreateComment

func (m *IssuesMock) CreateComment(ctx context.Context, owner string, repo string, number int, comment *github.IssueComment) (*github.IssueComment, *github.Response, error)

func (*IssuesMock) ListByRepo

func (m *IssuesMock) ListByRepo(ctx context.Context, owner string, repo string, opts *github.IssueListByRepoOptions) ([]*github.Issue, *github.Response, error)

type Paths

type Paths struct {
	Source      string
	Destination string
}

type PullRequestsMock

type PullRequestsMock struct {
	mock.Mock
}

func (*PullRequestsMock) CallCreate

func (m *PullRequestsMock) CallCreate(prNumber int)

func (*PullRequestsMock) CallGetAndReturnMergeabilityBeingEvaluated

func (m *PullRequestsMock) CallGetAndReturnMergeabilityBeingEvaluated(prNumber int)

func (*PullRequestsMock) CallGetAndReturnMergeable

func (m *PullRequestsMock) CallGetAndReturnMergeable(prNumber int, mergeable bool)

func (*PullRequestsMock) CallMerge

func (m *PullRequestsMock) CallMerge(prNumber int, tip string)

func (*PullRequestsMock) Create

func (*PullRequestsMock) Get

func (m *PullRequestsMock) Get(ctx context.Context, owner string, repo string, number int) (*github.PullRequest, *github.Response, error)

func (*PullRequestsMock) List

func (*PullRequestsMock) Merge

func (m *PullRequestsMock) Merge(ctx context.Context, owner string, repo string, number int, commitMessage string, options *github.PullRequestOptions) (*github.PullRequestMergeResult, *github.Response, error)

type TestRepo

type TestRepo struct {
	*core.Repo
	Source     *git.Repository
	GithubRepo *git.Repository
	Paths      Paths
	GithubMock *GithubMock
	App        *cli.App
	Out        *strings.Builder
}

func NewTestRepo

func NewTestRepo(t *testing.T) *TestRepo

func (*TestRepo) AlwaysFailingEditor

func (r *TestRepo) AlwaysFailingEditor()

func (*TestRepo) AssertHasPr

func (r *TestRepo) AssertHasPr(t *testing.T, n int) *core.LocalPr

func (*TestRepo) Commit

func (r *TestRepo) Commit(msg string) plumbing.Hash

func (*TestRepo) CreatePr

func (r *TestRepo) CreatePr(t *testing.T, ref string, prNumber int, args ...string) *core.LocalPr

func (*TestRepo) GetGithubMock

func (r *TestRepo) GetGithubMock(ctx context.Context) *GithubMock

func (*TestRepo) MergePr

func (r *TestRepo) MergePr(t *testing.T, pr *core.LocalPr) error

func (*TestRepo) PrepareSource

func (r *TestRepo) PrepareSource()

func (*TestRepo) RewriteLastCommit

func (r *TestRepo) RewriteLastCommit(msg string)

func (*TestRepo) Run

func (r *TestRepo) Run(command string, args ...string) error

Jump to

Keyboard shortcuts

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