(t *testing.T)
| 11 | ) |
| 12 | |
| 13 | func TestLoadConfig_InvalidPath(t *testing.T) { |
| 14 | t.Parallel() |
| 15 | tmp := t.TempDir() |
| 16 | tmpRoot := openRoot(t, tmp) |
| 17 | |
| 18 | validConfig := `version: 1 |
| 19 | agents: |
| 20 | root: |
| 21 | model: "openai/gpt-4" |
| 22 | ` |
| 23 | |
| 24 | err := tmpRoot.WriteFile("valid.yaml", []byte(validConfig), 0o644) |
| 25 | require.NoError(t, err) |
| 26 | |
| 27 | cfg, err := Load(t.Context(), NewFileSource(filepath.Join(tmp, "valid.yaml"))) |
| 28 | require.NoError(t, err) |
| 29 | require.NotNil(t, cfg) |
| 30 | |
| 31 | _, err = Load(t.Context(), NewFileSource(filepath.Join(tmp, "../../../etc/passwd"))) //nolint: gocritic // testing invalid path |
| 32 | require.Error(t, err) |
| 33 | } |
| 34 | |
| 35 | func TestValidationErrors(t *testing.T) { |
| 36 | t.Parallel() |
nothing calls this directly
no test coverage detected