testutil

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMockAWSProvider

func NewMockAWSProvider() providers.Provider

NewMockAWSProvider creates a new mock AWS provider

func NewMockAWSProviderWithProfiles

func NewMockAWSProviderWithProfiles(profiles []string) providers.Provider

NewMockAWSProviderWithProfiles creates a new mock AWS provider with custom profiles

func NewMockCodePipelineService

func NewMockCodePipelineService() providers.Service

NewMockCodePipelineService creates a new mock CodePipeline service

Types

type MockAWSProvider

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

MockAWSProvider is a mock implementation of the AWS provider for testing

func (*MockAWSProvider) ApproveAction

func (p *MockAWSProvider) ApproveAction(ctx context.Context, action providers.ApprovalAction, approved bool, comment string) error

ApproveAction approves or rejects an approval action

func (*MockAWSProvider) Authenticate

func (p *MockAWSProvider) Authenticate(method string, config map[string]string) error

Authenticate authenticates the provider with the given method and configuration

func (*MockAWSProvider) Configure

func (p *MockAWSProvider) Configure(config map[string]string) error

Configure configures the provider with the given configuration

func (*MockAWSProvider) Description

func (p *MockAWSProvider) Description() string

Description returns the description of the provider

func (*MockAWSProvider) GetApprovals

func (p *MockAWSProvider) GetApprovals(ctx context.Context) ([]providers.ApprovalAction, error)

GetApprovals returns all pending approvals for the provider

func (*MockAWSProvider) GetAuthConfigKeys

func (p *MockAWSProvider) GetAuthConfigKeys(method string) []string

GetAuthConfigKeys returns the configuration keys for the given authentication method

func (*MockAWSProvider) GetAuthenticationMethods

func (p *MockAWSProvider) GetAuthenticationMethods() []string

GetAuthenticationMethods returns the available authentication methods

func (*MockAWSProvider) GetCodePipelineManualApprovalOperation

func (p *MockAWSProvider) GetCodePipelineManualApprovalOperation() (providers.CodePipelineManualApprovalOperation, error)

GetCodePipelineManualApprovalOperation returns the CodePipeline manual approval operation

func (*MockAWSProvider) GetConfigKeys

func (p *MockAWSProvider) GetConfigKeys() []string

GetConfigKeys returns the configuration keys for the provider

func (*MockAWSProvider) GetConfigOptions

func (p *MockAWSProvider) GetConfigOptions(key string) ([]string, error)

GetConfigOptions returns the available options for the given configuration key

func (*MockAWSProvider) GetFunctionStatusOperation

func (p *MockAWSProvider) GetFunctionStatusOperation() (providers.FunctionStatusOperation, error)

GetFunctionStatusOperation returns the function status operation

func (*MockAWSProvider) GetPipelineStatusOperation

func (p *MockAWSProvider) GetPipelineStatusOperation() (providers.PipelineStatusOperation, error)

GetPipelineStatusOperation returns the pipeline status operation

func (*MockAWSProvider) GetProfiles

func (p *MockAWSProvider) GetProfiles() ([]string, error)

GetProfiles returns the available AWS profiles

func (*MockAWSProvider) GetStartPipelineOperation

func (p *MockAWSProvider) GetStartPipelineOperation() (providers.StartPipelineOperation, error)

GetStartPipelineOperation returns the start pipeline operation

func (*MockAWSProvider) GetStatus

GetStatus returns the status of all pipelines

func (*MockAWSProvider) IsAuthenticated

func (p *MockAWSProvider) IsAuthenticated() bool

IsAuthenticated returns whether the provider is authenticated

func (*MockAWSProvider) LoadConfig

func (p *MockAWSProvider) LoadConfig(profile, region string) error

LoadConfig loads the provider configuration

func (*MockAWSProvider) Name

func (p *MockAWSProvider) Name() string

Name returns the name of the provider

func (*MockAWSProvider) Services

func (p *MockAWSProvider) Services() []providers.Service

Services returns the available services

func (*MockAWSProvider) StartPipeline

func (p *MockAWSProvider) StartPipeline(ctx context.Context, pipelineName string, commitID string) error

StartPipeline starts a pipeline execution

type MockCodePipelineManualApprovalOperation

type MockCodePipelineManualApprovalOperation struct{}

MockCodePipelineManualApprovalOperation is a mock implementation of the CodePipeline manual approval operation

func (*MockCodePipelineManualApprovalOperation) ApproveAction

func (o *MockCodePipelineManualApprovalOperation) ApproveAction(ctx context.Context, approval providers.ApprovalAction, approve bool, comment string) error

ApproveAction approves or rejects an action

func (*MockCodePipelineManualApprovalOperation) Description

Description returns the description of the operation

func (*MockCodePipelineManualApprovalOperation) GetPendingApprovals

GetPendingApprovals returns the pending approvals

func (*MockCodePipelineManualApprovalOperation) IsUIVisible

IsUIVisible returns whether the operation is visible in the UI

func (*MockCodePipelineManualApprovalOperation) Name

Name returns the name of the operation

type MockCodePipelineService

type MockCodePipelineService struct{}

MockCodePipelineService is a mock implementation of the CodePipeline service

func (*MockCodePipelineService) Categories

func (s *MockCodePipelineService) Categories() []providers.Category

Categories returns the available categories

func (*MockCodePipelineService) Description

func (s *MockCodePipelineService) Description() string

Description returns the description of the service

func (*MockCodePipelineService) Name

func (s *MockCodePipelineService) Name() string

Name returns the name of the service

type MockFunctionStatusOperation

type MockFunctionStatusOperation struct{}

MockFunctionStatusOperation is a mock implementation of the FunctionStatusOperation interface

func (*MockFunctionStatusOperation) Description

func (o *MockFunctionStatusOperation) Description() string

Description returns the description of the operation

func (*MockFunctionStatusOperation) GetFunctionStatus

GetFunctionStatus returns mock function status data

func (*MockFunctionStatusOperation) IsUIVisible

func (o *MockFunctionStatusOperation) IsUIVisible() bool

IsUIVisible returns whether this operation should be visible in the UI

func (*MockFunctionStatusOperation) Name

Name returns the name of the operation

type MockOperation

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

MockOperation is a mock implementation of the Operation interface

func (*MockOperation) Description

func (o *MockOperation) Description() string

Description returns the description of the operation

func (*MockOperation) Execute

func (o *MockOperation) Execute(ctx context.Context, params map[string]interface{}) (interface{}, error)

Execute executes the operation with the given parameters

func (*MockOperation) IsUIVisible

func (o *MockOperation) IsUIVisible() bool

IsUIVisible returns whether the operation is visible in the UI

func (*MockOperation) Name

func (o *MockOperation) Name() string

Name returns the name of the operation

type MockOperationsCategory

type MockOperationsCategory struct{}

MockOperationsCategory is a mock implementation of the Operations category

func (*MockOperationsCategory) Description

func (c *MockOperationsCategory) Description() string

Description returns the description of the category

func (*MockOperationsCategory) IsUIVisible

func (c *MockOperationsCategory) IsUIVisible() bool

IsUIVisible returns whether the category is visible in the UI

func (*MockOperationsCategory) Name

func (c *MockOperationsCategory) Name() string

Name returns the name of the category

func (*MockOperationsCategory) Operations

func (c *MockOperationsCategory) Operations() []providers.Operation

Operations returns the available operations

type MockPipelineStatusOperation

type MockPipelineStatusOperation struct{}

MockPipelineStatusOperation is a mock implementation of the Pipeline Status operation

func (*MockPipelineStatusOperation) Description

func (o *MockPipelineStatusOperation) Description() string

Description returns the description of the operation

func (*MockPipelineStatusOperation) GetPipelineStatus

GetPipelineStatus returns the pipeline status

func (*MockPipelineStatusOperation) IsUIVisible

func (o *MockPipelineStatusOperation) IsUIVisible() bool

IsUIVisible returns whether the operation is visible in the UI

func (*MockPipelineStatusOperation) Name

Name returns the name of the operation

type MockStartPipelineOperation

type MockStartPipelineOperation struct{}

MockStartPipelineOperation is a mock implementation of the Start Pipeline operation

func (*MockStartPipelineOperation) Description

func (o *MockStartPipelineOperation) Description() string

Description returns the description of the operation

func (*MockStartPipelineOperation) IsUIVisible

func (o *MockStartPipelineOperation) IsUIVisible() bool

IsUIVisible returns whether the operation is visible in the UI

func (*MockStartPipelineOperation) Name

Name returns the name of the operation

func (*MockStartPipelineOperation) StartPipelineExecution

func (o *MockStartPipelineOperation) StartPipelineExecution(ctx context.Context, pipelineName, commitID string) error

StartPipelineExecution starts a pipeline execution

Jump to

Keyboard shortcuts

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