Documentation
¶
Overview ¶
Package testutil provides some common test functions
Index ¶
- func GetEnvOrDefault(key, defaultValue string) string
- func IsLiveTesting() bool
- func NewAPIClient(t *testing.T) (*cmlclient.Client, func())
- func NewAPIClientWithConfig(t *testing.T, config ClientConfig) (*cmlclient.Client, func())
- func RequireLive(t *testing.T)
- func SetupCommonMocks()
- func SkipIfLive(t *testing.T)
- type ClientConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetEnvOrDefault ¶
GetEnvOrDefault returns environment variable value or default
func IsLiveTesting ¶
func IsLiveTesting() bool
IsLiveTesting returns true if running against live backend
func NewAPIClient ¶
NewAPIClient creates a test API client - either mock or live based on TEST_LIVE env var
func NewAPIClientWithConfig ¶
func NewAPIClientWithConfig(t *testing.T, config ClientConfig) (*cmlclient.Client, func())
NewAPIClientWithConfig creates a test API client with custom config
func RequireLive ¶
RequireLive skips the test if not running in live mode
func SetupCommonMocks ¶
func SetupCommonMocks()
SetupCommonMocks sets up HTTP mocks common across all services
Types ¶
type ClientConfig ¶
ClientConfig holds configuration for test clients
func DefaultConfig ¶
func DefaultConfig() ClientConfig
DefaultConfig returns default test configuration from environment
Click to show internal directories.
Click to hide internal directories.