Files
goclaw/tests/contracts/http_api/models_test.go
T
viettranx 6e7e15cf4a test(contracts): complete P1 contract tests with schemas and policy
- Add config.get, skills.list WS contract tests
- Add /v1/providers HTTP contract test
- Add JSON schemas for ws_connect, ws_chat_send, http_chat_completions
- Document breaking change policy
2026-04-12 21:52:29 +07:00

27 lines
656 B
Go

//go:build integration
package http_api
import "testing"
// CONTRACT: /v1/providers response MUST include providers array.
func TestContract_HTTP_ProvidersList(t *testing.T) {
baseURL, token := getTestServer(t)
client := newHTTPClient(baseURL, token)
resp := client.get(t, "/v1/providers")
assertField(t, resp, "providers", "array")
providers, ok := resp["providers"].([]any)
if !ok || len(providers) == 0 {
t.Log("No providers - skipping field checks")
return
}
provider := providers[0].(map[string]any)
assertField(t, provider, "id", "string")
assertField(t, provider, "name", "string")
assertField(t, provider, "type", "string")
}