providertest

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package providertest provides shared test utilities for provider conformance testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestProviderComplete

func TestProviderComplete(t *testing.T, p provider.Provider)

TestProviderComplete runs a basic non-streaming completion test using a mock. The provider must be configured to use a mock server.

func TestProviderContract

func TestProviderContract(t *testing.T, p provider.Provider)

TestProviderContract runs all conformance checks on a provider.Provider implementation. Every provider must pass these basic contract tests.

func TestProviderEmbed

func TestProviderEmbed(t *testing.T, p provider.Provider)

TestProviderEmbed runs a basic embedding test using a mock.

func TestProviderEmbedNotSupported

func TestProviderEmbedNotSupported(t *testing.T, p provider.Provider)

TestProviderEmbedNotSupported verifies that a provider correctly returns ErrNotSupported.

func TestProviderRejectsMissingAPIKey

func TestProviderRejectsMissingAPIKey(t *testing.T, p provider.Provider)

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.

Jump to

Keyboard shortcuts

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