(t *testing.T)
| 1132 | } |
| 1133 | |
| 1134 | func TestCodexEngineWebFetch(t *testing.T) { |
| 1135 | engine := NewCodexEngine() |
| 1136 | |
| 1137 | t.Run("disables fetch by default when web-fetch tool not specified", func(t *testing.T) { |
| 1138 | workflowData := &WorkflowData{ |
| 1139 | Name: "test-workflow", |
| 1140 | } |
| 1141 | steps := engine.GetExecutionSteps(workflowData, "test-log") |
| 1142 | if len(steps) != 1 { |
| 1143 | t.Fatalf("Expected 1 step, got %d", len(steps)) |
| 1144 | } |
| 1145 | stepContent := strings.Join([]string(steps[0]), "\n") |
| 1146 | if !strings.Contains(stepContent, `-c fetch="disabled"`) { |
| 1147 | t.Errorf(`Expected -c fetch="disabled" config when web-fetch tool is not specified, got:\n%s`, stepContent) |
| 1148 | } |
| 1149 | }) |
| 1150 | |
| 1151 | t.Run("fetch tool enabled when web-fetch tool is specified", func(t *testing.T) { |
| 1152 | workflowData := &WorkflowData{ |
| 1153 | Name: "test-workflow", |
| 1154 | ParsedTools: &ToolsConfig{ |
| 1155 | WebFetch: &WebFetchToolConfig{}, |
| 1156 | }, |
| 1157 | } |
| 1158 | steps := engine.GetExecutionSteps(workflowData, "test-log") |
| 1159 | if len(steps) != 1 { |
| 1160 | t.Fatalf("Expected 1 step, got %d", len(steps)) |
| 1161 | } |
| 1162 | stepContent := strings.Join([]string(steps[0]), "\n") |
| 1163 | if strings.Contains(stepContent, `-c fetch="disabled"`) { |
| 1164 | t.Errorf(`Expected no -c fetch="disabled" config when web-fetch tool is specified, got:\n%s`, stepContent) |
| 1165 | } |
| 1166 | }) |
| 1167 | } |
| 1168 | |
| 1169 | func TestCodexEngineWithExpressionVersion(t *testing.T) { |
| 1170 | engine := NewCodexEngine() |
nothing calls this directly
no test coverage detected