oficina / equipo Public

Clone
git clone https://amadan.net/oficina/equipo

Plain git — no account needed to clone.

Download

Download this file

1package codex
2
3import "testing"
4
5const disabledProjectReason = "To load project-local config, hooks, and exec policies, add /workspace as a trusted project in /home/runner/config.toml."
6
7func TestCodexDisabledEmptyProjectLayer(t *testing.T) {
8 for _, mode := range []string{"observed", "enabled", "config", "path", "reason", "duplicate"} {
9 t.Run(mode, func(t *testing.T) {
10 v, p := liveConfig(t)
11 layer := map[string]any{"name": map[string]any{"type": "project", "dotCodexFolder": "/workspace/.codex"}, "version": "pinned-observation", "config": map[string]any{}, "disabledReason": disabledProjectReason}
12 switch mode {
13 case "enabled":
14 layer["disabledReason"] = nil
15 case "config":
16 layer["config"] = map[string]any{"hooks": true}
17 case "path":
18 layer["name"] = map[string]any{"type": "project", "dotCodexFolder": "/other/.codex"}
19 case "reason":
20 layer["disabledReason"] = "other"
21 }
22 v["layers"] = append(v["layers"].([]any), layer)
23 if mode == "duplicate" {
24 v["layers"] = append(v["layers"].([]any), layer)
25 }
26 err := validateConfig(marshal(v), p)
27 if (err == nil) != (mode == "observed") {
28 t.Fatalf("%s: %v", mode, err)
29 }
30 })
31 }
32}
33