Documentation
¶
Overview ¶
Package providertest provides shared test utilities for provider conformance testing.
Index ¶
- func TestProviderComplete(t *testing.T, p provider.Provider)
- func TestProviderContract(t *testing.T, p provider.Provider)
- func TestProviderEmbed(t *testing.T, p provider.Provider)
- func TestProviderEmbedNotSupported(t *testing.T, p provider.Provider)
- func TestProviderRejectsMissingAPIKey(t *testing.T, p provider.Provider)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TestProviderComplete ¶
TestProviderComplete runs a basic non-streaming completion test using a mock. The provider must be configured to use a mock server.
func TestProviderContract ¶
TestProviderContract runs all conformance checks on a provider.Provider implementation. Every provider must pass these basic contract tests.
func TestProviderEmbed ¶
TestProviderEmbed runs a basic embedding test using a mock.
func TestProviderEmbedNotSupported ¶
TestProviderEmbedNotSupported verifies that a provider correctly returns ErrNotSupported.
func TestProviderRejectsMissingAPIKey ¶
TestProviderRejectsMissingAPIKey verifies that a provider constructed without a credential fails fast on Complete with provider.ErrMissingAPIKey, rather than dispatching a request with an empty auth header and surfacing a cryptic upstream 401. Pass a provider built with an empty API key — ideally pointed at a mock server so a leaked network call is observable in the test.
Types ¶
This section is empty.