apimocks

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package apimocks provides mock implementations for API interfaces. It's in a separate package to avoid import cycles with the api package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockProfileManager

type MockProfileManager struct {
	*config.ProfileManager
	// contains filtered or unexported fields
}

MockProfileManager provides a test-friendly ProfileManager that doesn't require real authentication

func NewMockProfileManager

func NewMockProfileManager(t *testing.T) *MockProfileManager

NewMockProfileManager creates a ProfileManager suitable for testing

func (*MockProfileManager) ActionCli

func (m *MockProfileManager) ActionCli() api.ActionInterface

func (*MockProfileManager) Auth

func (m *MockProfileManager) Auth(ctx context.Context) error

Auth does nothing for tests

func (*MockProfileManager) CheckAuth

func (m *MockProfileManager) CheckAuth() bool

CheckAuth always returns true for tests

func (*MockProfileManager) CustomFieldCli added in v1.6.0

func (m *MockProfileManager) CustomFieldCli() api.CustomFieldInterface

func (*MockProfileManager) EventCli

func (m *MockProfileManager) EventCli() api.EventInterface

func (*MockProfileManager) FileCli

func (m *MockProfileManager) FileCli() api.FileInterface

func (*MockProfileManager) GetProjectUrl

func (m *MockProfileManager) GetProjectUrl(ctx context.Context, projectName *name.Project) (string, error)

GetProjectUrl returns a test URL

func (*MockProfileManager) GetRecordUrl

func (m *MockProfileManager) GetRecordUrl(ctx context.Context, recordName *name.Record) (string, error)

GetRecordUrl returns a test URL

func (*MockProfileManager) LabelCli

func (m *MockProfileManager) LabelCli() api.LabelInterface

func (*MockProfileManager) ProjectCli

func (m *MockProfileManager) ProjectCli() api.ProjectInterface

func (*MockProfileManager) ProjectName

func (m *MockProfileManager) ProjectName(ctx context.Context, projectSlug string) (*name.Project, error)

ProjectName returns a test project name without requiring real API calls

func (*MockProfileManager) RecordCli

func (m *MockProfileManager) RecordCli() api.RecordInterface

Override methods to return mock clients

func (*MockProfileManager) SetCustomFieldClient added in v1.6.0

func (m *MockProfileManager) SetCustomFieldClient(client api.CustomFieldInterface)

func (*MockProfileManager) SetFileClient

func (m *MockProfileManager) SetFileClient(client api.FileInterface)

SetFileClient sets a mock file client for testing

func (*MockProfileManager) SetLabelClient

func (m *MockProfileManager) SetLabelClient(client api.LabelInterface)

SetLabelClient sets a mock label client for testing

func (*MockProfileManager) SetProjectClient

func (m *MockProfileManager) SetProjectClient(client api.ProjectInterface)

SetProjectClient sets a mock project client for testing

func (*MockProfileManager) SetRecordClient

func (m *MockProfileManager) SetRecordClient(client api.RecordInterface)

SetRecordClient sets a mock record client for testing

func (*MockProfileManager) TaskCli

func (m *MockProfileManager) TaskCli() api.TaskInterface

type MockProvider

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

MockProvider implements config.Provider for testing

func NewMockProvider

func NewMockProvider(t *testing.T) *MockProvider

NewMockProvider creates a test provider with a mock ProfileManager

func (*MockProvider) GetProfileManager

func (p *MockProvider) GetProfileManager() (*config.ProfileManager, error)

GetProfileManager returns the mock ProfileManager

func (*MockProvider) Persist

func (p *MockProvider) Persist(pm *config.ProfileManager) error

Persist is a no-op for tests

func (*MockProvider) ProfileManager

func (p *MockProvider) ProfileManager() *MockProfileManager

ProfileManager returns the mock ProfileManager (for test setup)

func (*MockProvider) SetProfileManager

func (p *MockProvider) SetProfileManager(pm *MockProfileManager)

SetProfileManager sets a custom ProfileManager for testing

Jump to

Keyboard shortcuts

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