Documentation
¶
Overview ¶
Package testutil contains shared helpers for offline and live test execution.
Index ¶
- func NewMockBetaClient(t *testing.T, server *MockDeepSeekServer, opts ...deepseek.Option) *deepseek.Client
- func NewMockClient(t *testing.T, server *MockDeepSeekServer, opts ...deepseek.Option) *deepseek.Client
- func SkipIfShort(t *testing.T)
- func SkipUnlessLiveAPI(t *testing.T)
- func WriteJSON(t *testing.T, w http.ResponseWriter, status int, body interface{})
- func WriteSSE(t *testing.T, w http.ResponseWriter, chunks ...string)
- type MockDeepSeekServer
- type TestConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMockBetaClient ¶ added in v1.3.4
func NewMockBetaClient(t *testing.T, server *MockDeepSeekServer, opts ...deepseek.Option) *deepseek.Client
NewMockBetaClient creates a client configured to talk to the mock server's beta API endpoints.
func NewMockClient ¶ added in v1.3.4
func NewMockClient(t *testing.T, server *MockDeepSeekServer, opts ...deepseek.Option) *deepseek.Client
NewMockClient creates a client configured to talk to the mock server's standard API endpoints.
func SkipIfShort ¶
SkipIfShort skips long-running tests when -short flag is used
func SkipUnlessLiveAPI ¶ added in v1.3.4
SkipUnlessLiveAPI skips tests unless the live API opt-in flag is enabled.
Types ¶
type MockDeepSeekServer ¶ added in v1.3.4
func NewMockDeepSeekServer ¶ added in v1.3.4
func NewMockDeepSeekServer(t *testing.T) *MockDeepSeekServer
NewMockDeepSeekServer creates a local HTTP server that mimics the small subset of DeepSeek endpoints used by tests.
func (*MockDeepSeekServer) BaseURL ¶ added in v1.3.4
func (s *MockDeepSeekServer) BaseURL() string
BaseURL returns the mock server base URL for standard API endpoints.
func (*MockDeepSeekServer) BetaBaseURL ¶ added in v1.3.4
func (s *MockDeepSeekServer) BetaBaseURL() string
BetaBaseURL returns the mock server base URL for beta endpoints.
type TestConfig ¶
TestConfig holds test configuration loaded from environment
func LoadTestConfig ¶
func LoadTestConfig(t *testing.T) *TestConfig
LoadTestConfig loads test configuration from environment variables