(t *testing.T)
| 235 | } |
| 236 | |
| 237 | func TestIsToolSafeForAutoApproval(t *testing.T) { |
| 238 | safeTool := &mockToolWithAnnotations{name: "safe", annotations: AnnotationsSafeReadOnly} |
| 239 | unsafeTool := &mockToolWithAnnotations{name: "unsafe", annotations: AnnotationsDestructiveWrite} |
| 240 | noAnnotationTool := &mockToolWithoutAnnotations{name: "none"} |
| 241 | |
| 242 | if !IsToolSafeForAutoApproval(safeTool) { |
| 243 | t.Error("Safe read-only tool should be safe for auto approval") |
| 244 | } |
| 245 | if IsToolSafeForAutoApproval(unsafeTool) { |
| 246 | t.Error("Destructive tool should not be safe for auto approval") |
| 247 | } |
| 248 | if IsToolSafeForAutoApproval(noAnnotationTool) { |
| 249 | t.Error("Tool without annotations should not be safe for auto approval by default") |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | func TestGetToolRiskLevel(t *testing.T) { |
| 254 | highRiskTool := &mockToolWithAnnotations{name: "high", annotations: AnnotationsDestructiveWrite} |
nothing calls this directly
no test coverage detected