Migrate facade tests to the new configuration contracts

This commit is contained in:
2026-11-21 14:36:07 +00:00
parent cf03bca753
commit bab3422e62
47 changed files with 183 additions and 155 deletions

View File

@@ -29,7 +29,7 @@ func TestSchemaFilePreparationAndNativeSubmission(t *testing.T) {
if err := os.WriteFile(second, []byte(`{"$defs":{"value":{"type":"integer"}},"$ref":"#/$defs/value"}`), 0600); err != nil {
t.Fatal(err)
}
input := configkit.Input{Source: configkit.Mapping("schema test", map[string]any{
input := configkit.Input{Destination: configkit.Keys("promptkit"), Source: configkit.Mapping("schema test", map[string]any{
"profiles": []any{map[string]any{"id": "profile", "endpoint": "https://example.invalid/v1", "model": "model"}},
"prompts": []any{map[string]any{"id": "prompt", "default_profile": "profile", "messages": []any{map[string]any{"role": "user", "content": "hello"}}, "output": map[string]any{"format": "json", "validation_mode": "json_schema", "schema_file": "schema.json"}}},
})}
@@ -95,7 +95,7 @@ func TestSchemaFilePreparationDetachesLargeAnnotation(t *testing.T) {
if err := os.WriteFile(path, []byte(schema), 0o600); err != nil {
t.Fatal(err)
}
input := configkit.Input{Source: configkit.Mapping("schema test", map[string]any{
input := configkit.Input{Destination: configkit.Keys("promptkit"), Source: configkit.Mapping("schema test", map[string]any{
"profiles": []any{map[string]any{"id": "profile", "endpoint": "https://example.invalid/v1", "model": "model"}},
"prompts": []any{map[string]any{"id": "prompt", "default_profile": "profile", "messages": []any{map[string]any{"role": "user", "content": "hello"}}, "output": map[string]any{"format": "json", "validation_mode": "json_schema", "schema_file": "schema.json"}}},
})}
@@ -127,7 +127,7 @@ func TestSchemaFileRejectsInvalidSourcesAndExternalReferences(t *testing.T) {
if err := os.WriteFile(root, []byte(`{"$defs":{"unused":{"$ref":"other.json"}}}`), 0600); err != nil {
t.Fatal(err)
}
input := configkit.Input{Source: configkit.Mapping("schema test", map[string]any{
input := configkit.Input{Destination: configkit.Keys("promptkit"), Source: configkit.Mapping("schema test", map[string]any{
"profiles": []any{map[string]any{"id": "profile", "endpoint": "https://example.invalid/v1", "model": "model"}},
"prompts": []any{map[string]any{"id": "prompt", "default_profile": "profile", "messages": []any{map[string]any{"role": "user", "content": "hello"}}, "output": map[string]any{"format": "json", "validation_mode": "json_schema", "schema_file": "schema.json"}}},
})}