cmdtest

package
v1.135.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package cmdtest holds shared test fixtures for pkg/cmd subcommand tests. Lives outside _test.go so subpackages anywhere under pkg/cmd can import it.

Index

Constants

View Source
const Config = "bitbucket.org:\n  oauth_token: tok\n  user: alice\n  git_protocol: https\n"

Config is the shared single-host Cloud config used by command tests.

View Source
const PRConfig = "bb.example.com:\n  oauth_token: tok\n  user: alice\n  git_protocol: ssh\n"

PRConfig is the shared single-host Bitbucket Server config used by pr command tests.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory(t *testing.T, fake backend.Client, runner *testhelpers.FakeRunner) (*factory.Factory, *bytes.Buffer, *bytes.Buffer)

NewFactory wires the shared config, a backend.Client, and a runner.

func NewPRFactory added in v1.84.0

func NewPRFactory(t *testing.T, fake backend.Client, runner *testhelpers.FakeRunner) (*factory.Factory, *bytes.Buffer, *bytes.Buffer)

NewPRFactory wires the shared PR Server config, a backend.Client, and a runner.

func NewPRRunner added in v1.84.0

func NewPRRunner(extra ...testhelpers.RunResponse) *testhelpers.FakeRunner

NewPRRunner returns a FakeRunner pre-seeded with the remote URL response needed by PR sub-commands that operate on an existing PR.

func NewRunner

func NewRunner() *testhelpers.FakeRunner

NewRunner returns a FakeRunner pre-seeded with a remote URL response.

Types

type NoBranchModelFake added in v1.92.0

type NoBranchModelFake struct {
	backend.Client
}

NoBranchModelFake wraps backend.Client without implementing backend.BranchModelClient — simulates a Bitbucket Server backend.

type NoBranchRuleFake added in v1.53.0

type NoBranchRuleFake struct {
	backend.Client
}

NoBranchRuleFake wraps backend.Client without implementing backend.BranchRuleClient — simulates a Bitbucket Server backend.

type NoDefaultReviewerFake added in v1.50.0

type NoDefaultReviewerFake struct {
	backend.Client
}

NoDefaultReviewerFake wraps backend.Client without implementing backend.DefaultReviewerClient — simulates a backend that doesn't support default reviewer management.

type NoDeployKeyFake added in v1.47.0

type NoDeployKeyFake struct {
	backend.Client
}

NoDeployKeyFake wraps backend.Client without implementing backend.DeployKeyClient — simulates a backend that doesn't support deploy keys.

type NoDeploymentFake

type NoDeploymentFake struct {
	backend.Client
}

NoDeploymentFake wraps backend.Client without implementing backend.DeploymentClient — simulates a Bitbucket Server backend.

type NoPipelineFake

type NoPipelineFake struct {
	backend.Client
}

NoPipelineFake wraps backend.Client without implementing backend.PipelineClient — simulates a Bitbucket Server backend. Embedding the interface (not the concrete FakeClient) prevents pipeline-method promotion.

type NoSSHKeyFake added in v1.51.0

type NoSSHKeyFake struct {
	backend.Client
}

NoSSHKeyFake wraps backend.Client without implementing backend.SSHKeyClient — simulates a Bitbucket Server backend.

type NoWorkspaceVarFake

type NoWorkspaceVarFake struct {
	backend.Client
}

NoWorkspaceVarFake wraps backend.Client without implementing backend.WorkspaceVariableClient.

Jump to

Keyboard shortcuts

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