MCPcopy Create free account
hub / github.com/github/gh-aw / TestCodexEngineWebFetch

Function TestCodexEngineWebFetch

pkg/workflow/codex_engine_test.go:1134–1167  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1132}
1133
1134func 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
1169func TestCodexEngineWithExpressionVersion(t *testing.T) {
1170 engine := NewCodexEngine()

Callers

nothing calls this directly

Calls 4

GetExecutionStepsMethod · 0.95
NewCodexEngineFunction · 0.85
RunMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected