tests

package
v0.0.0-...-363660f Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: MIT Imports: 21 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 StoryFetcherMock

type StoryFetcherMock struct {
	mock.Mock
}

func (*StoryFetcherMock) CallFetchInProgressStories

func (s *StoryFetcherMock) CallFetchInProgressStories(stories []story.Story, fetchError bool)

func (*StoryFetcherMock) FetchInProgressStories

func (s *StoryFetcherMock) FetchInProgressStories(ctx context.Context) ([]story.Story, error)

type TestRepo

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

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) CreatePrAssertPrDetails

func (r *TestRepo) CreatePrAssertPrDetails(t *testing.T, ref string, prNumber int, prDetails github.NewPullRequest, args ...string) *core.LocalPr

func (*TestRepo) CreatePrAssertPrDetailsWithStories

func (r *TestRepo) CreatePrAssertPrDetailsWithStories(t *testing.T, ref string, prNumber int, stories []story.Story, errStories bool, selectedStory string, prDetails github.NewPullRequest, args ...string) *core.LocalPr

func (*TestRepo) CreatePrWithStories

func (r *TestRepo) CreatePrWithStories(t *testing.T, ref string, prNumber int, stories []story.Story, errStories bool, selectedStory string, 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