mocks

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockAuthManager

type MockAuthManager struct {
	// SaveToken tracking
	SaveTokenCalled bool
	SavedWorkspace  string
	SavedToken      *auth.Token
	SaveTokenErr    error

	// GetToken tracking
	GetTokenCalled    bool
	GetTokenWorkspace string
	GetTokenResult    *auth.Token
	GetTokenErr       error

	// DeleteToken tracking
	DeleteTokenCalled bool
	DeletedWorkspace  string
	DeleteTokenErr    error

	// GetCurrentToken tracking
	GetCurrentTokenCalled bool
	GetCurrentTokenResult *auth.Token
	GetCurrentTokenErr    error

	// IsAuthenticated tracking
	IsAuthenticatedCalled    bool
	IsAuthenticatedWorkspace string
	IsAuthenticatedResult    bool

	// ListWorkspaces tracking
	ListWorkspacesCalled bool
	ListWorkspacesResult []string
	ListWorkspacesErr    error
}

MockAuthManager is a mock implementation of AuthManager for testing

func (*MockAuthManager) DeleteToken

func (m *MockAuthManager) DeleteToken(workspace string) error

DeleteToken removes an auth token

func (*MockAuthManager) GetCurrentToken

func (m *MockAuthManager) GetCurrentToken() (*auth.Token, error)

GetCurrentToken gets the current token

func (*MockAuthManager) GetToken

func (m *MockAuthManager) GetToken(workspace string) (*auth.Token, error)

GetToken retrieves an auth token

func (*MockAuthManager) HasToken

func (m *MockAuthManager) HasToken(workspace string) bool

HasToken checks if a token exists

func (*MockAuthManager) IsAuthenticated

func (m *MockAuthManager) IsAuthenticated(workspace string) bool

IsAuthenticated checks if the user is authenticated

func (*MockAuthManager) ListTokens

func (m *MockAuthManager) ListTokens() (map[string]*auth.Token, error)

ListTokens returns all stored tokens (legacy method)

func (*MockAuthManager) ListWorkspaces

func (m *MockAuthManager) ListWorkspaces() ([]string, error)

ListWorkspaces returns all workspaces

func (*MockAuthManager) SaveToken

func (m *MockAuthManager) SaveToken(workspace string, token *auth.Token) error

SaveToken saves an auth token

type MockConfigProvider

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

MockConfigProvider is a mock implementation of ConfigProvider for testing

func NewMockConfigProvider

func NewMockConfigProvider() *MockConfigProvider

NewMockConfigProvider creates a new mock config provider

func (*MockConfigProvider) AllSettings

func (m *MockConfigProvider) AllSettings() map[string]interface{}

AllSettings returns all settings

func (*MockConfigProvider) Get

func (m *MockConfigProvider) Get(key string) interface{}

Get returns a configuration value

func (*MockConfigProvider) GetBool

func (m *MockConfigProvider) GetBool(key string) bool

GetBool returns a boolean configuration value

func (*MockConfigProvider) GetInt

func (m *MockConfigProvider) GetInt(key string) int

GetInt returns an integer configuration value

func (*MockConfigProvider) GetString

func (m *MockConfigProvider) GetString(key string) string

GetString returns a string configuration value

func (*MockConfigProvider) GetStringMap

func (m *MockConfigProvider) GetStringMap(key string) map[string]interface{}

GetStringMap returns a string map configuration value

func (*MockConfigProvider) GetStringSlice

func (m *MockConfigProvider) GetStringSlice(key string) []string

GetStringSlice returns a string slice configuration value

func (*MockConfigProvider) IsSet

func (m *MockConfigProvider) IsSet(key string) bool

IsSet checks if a key exists

func (*MockConfigProvider) Set

func (m *MockConfigProvider) Set(key string, value interface{})

Set sets a configuration value

type MockConfigWithProject

type MockConfigWithProject struct {
	*MockConfigProvider
	HasProjectConfigVal  bool
	ProjectConfigSaved   bool
	ProjectSettings      map[string]interface{}
	SaveProjectConfigErr error
	ProjectConfigPath    string
}

MockConfigWithProject is a mock config that supports project config operations

func (*MockConfigWithProject) GetProjectConfigPath

func (m *MockConfigWithProject) GetProjectConfigPath() string

func (*MockConfigWithProject) HasProjectConfig

func (m *MockConfigWithProject) HasProjectConfig() bool

func (*MockConfigWithProject) SaveProjectConfig

func (m *MockConfigWithProject) SaveProjectConfig(settings map[string]interface{}) error

type MockConfigWithSaveError

type MockConfigWithSaveError struct {
	*MockConfigProvider
	SaveErr error
}

MockConfigWithSaveError is a mock config that returns save errors

func (*MockConfigWithSaveError) Save

func (m *MockConfigWithSaveError) Save() error

type MockOutputFormatter

type MockOutputFormatter struct {
	// Storage for captured outputs
	Printed      []interface{}
	Errors       []error
	SuccessMsg   []string
	WarningMsg   []string
	InfoMsg      []string
	Format       string
	ColorEnabled bool
	QuietMode    bool
	Headers      []string

	// Control behavior
	PrintErr    error // Renamed to avoid conflict with method
	FormatError error
}

MockOutputFormatter is a mock implementation of OutputFormatter for testing

func NewMockOutputFormatter

func NewMockOutputFormatter() *MockOutputFormatter

NewMockOutputFormatter creates a new mock output formatter

func (*MockOutputFormatter) GetFormat

func (m *MockOutputFormatter) GetFormat() string

GetFormat returns the current format

func (*MockOutputFormatter) Print

func (m *MockOutputFormatter) Print(data interface{}) error

Print captures the data being printed

func (*MockOutputFormatter) PrintError

func (m *MockOutputFormatter) PrintError(err error)

PrintError captures error messages

func (*MockOutputFormatter) PrintInfo

func (m *MockOutputFormatter) PrintInfo(message string)

PrintInfo captures info messages

func (*MockOutputFormatter) PrintSuccess

func (m *MockOutputFormatter) PrintSuccess(message string)

PrintSuccess captures success messages

func (*MockOutputFormatter) PrintTo

func (m *MockOutputFormatter) PrintTo(w io.Writer, data interface{}) error

PrintTo captures the data being printed to a writer

func (*MockOutputFormatter) PrintWarning

func (m *MockOutputFormatter) PrintWarning(message string)

PrintWarning captures warning messages

func (*MockOutputFormatter) Reset

func (m *MockOutputFormatter) Reset()

Reset clears all captured data

func (*MockOutputFormatter) SetColor

func (m *MockOutputFormatter) SetColor(enabled bool)

SetColor sets color output

func (*MockOutputFormatter) SetFormat

func (m *MockOutputFormatter) SetFormat(format string) error

SetFormat sets the output format

func (*MockOutputFormatter) SetQuiet

func (m *MockOutputFormatter) SetQuiet(enabled bool)

SetQuiet sets quiet mode

func (*MockOutputFormatter) SetTableHeader

func (m *MockOutputFormatter) SetTableHeader(headers []string)

SetTableHeader sets table headers

Jump to

Keyboard shortcuts

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