Migrate facade tests to the new configuration contracts
This commit is contained in:
@@ -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"}}},
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user