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 ¶
- type MockProfileManager
- func (m *MockProfileManager) ActionCli() api.ActionInterface
- func (m *MockProfileManager) Auth(ctx context.Context) error
- func (m *MockProfileManager) CheckAuth() bool
- func (m *MockProfileManager) CustomFieldCli() api.CustomFieldInterface
- func (m *MockProfileManager) EventCli() api.EventInterface
- func (m *MockProfileManager) FileCli() api.FileInterface
- func (m *MockProfileManager) GetProjectUrl(ctx context.Context, projectName *name.Project) (string, error)
- func (m *MockProfileManager) GetRecordUrl(ctx context.Context, recordName *name.Record) (string, error)
- func (m *MockProfileManager) LabelCli() api.LabelInterface
- func (m *MockProfileManager) ProjectCli() api.ProjectInterface
- func (m *MockProfileManager) ProjectName(ctx context.Context, projectSlug string) (*name.Project, error)
- func (m *MockProfileManager) RecordCli() api.RecordInterface
- func (m *MockProfileManager) SetCustomFieldClient(client api.CustomFieldInterface)
- func (m *MockProfileManager) SetFileClient(client api.FileInterface)
- func (m *MockProfileManager) SetLabelClient(client api.LabelInterface)
- func (m *MockProfileManager) SetProjectClient(client api.ProjectInterface)
- func (m *MockProfileManager) SetRecordClient(client api.RecordInterface)
- func (m *MockProfileManager) TaskCli() api.TaskInterface
- type MockProvider
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