Documentation
¶
Overview ¶
Package modelsdevtest provides shared models.dev test doubles: fixture providers and the httptest servers that serve them, so library and CLI tests exercise the same deterministic, network-free models.dev.
Index ¶
- Variables
- func CatalogJSON(present, malformed []string) []byte
- func Closed(t *testing.T) string
- func CountingServer(t *testing.T, present []string) (*httptest.Server, *atomic.Int64)
- func MustNotFetch(t *testing.T) string
- func Provider(pid string, malformed bool) modelsdev.Provider
- func Server(t *testing.T, present []string, malformed ...string) *httptest.Server
Constants ¶
This section is empty.
Variables ¶
var ReleaseDates = map[string]string{
"anthropic": "2025-06-01",
"google": "2024-01-01",
"openai": "2025-01-01",
}
ReleaseDates gives each fixture provider's model a distinct release date so newest-first ordering is observable across providers.
Functions ¶
func CatalogJSON ¶
CatalogJSON is the fixture catalog bytes: present providers valid, malformed fail validation. Used when a test needs raw bytes rather than a live server.
func CountingServer ¶
CountingServer is Server with a fetch counter so a test can assert a single operation fetches models.dev once however many goroutines it fans out.
func MustNotFetch ¶
MustNotFetch returns a models.dev URL whose any access fails the test: proof that a code path stays offline.
Types ¶
This section is empty.