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

Function TestEvalUpdateIssueReverted

pkg/cli/outcome_eval_update_test.go:57–90  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

55}
56
57func TestEvalUpdateIssueReverted(t *testing.T) {
58 old := outcomeUpdateGHAPIGet
59 t.Cleanup(func() {
60 outcomeUpdateGHAPIGet = old
61 })
62 outcomeUpdateGHAPIGet = func(endpoint string, repo string) (map[string]any, error) {
63 return map[string]any{
64 "title": "Old title",
65 "body": "Old body",
66 "state": "open",
67 }, nil
68 }
69
70 report := evalUpdateIssue(CreatedItemReport{
71 Type: "update_issue",
72 Number: 12,
73 Repo: "owner/repo",
74 BeforeState: map[string]any{
75 "title": "Old title",
76 "body_hash": mutableBodyHash("Old body"),
77 "state": "open",
78 },
79 AfterState: map[string]any{
80 "title": "New title",
81 "body_hash": mutableBodyHash("New body"),
82 "state": "closed",
83 },
84 }, "owner/repo")
85
86 assert.Equal(t, OutcomeRejected, report.Result)
87 assert.Equal(t, OutcomeStatusRejected, report.OutcomeStatus)
88 assert.Equal(t, EvidenceStrong, report.EvidenceStrength)
89 assert.Equal(t, "state_reverted", report.Signal)
90}
91
92func TestEvalUpdatePullRequestRetainedAndMerged(t *testing.T) {
93 old := outcomeUpdateGHAPIGet

Callers

nothing calls this directly

Calls 2

evalUpdateIssueFunction · 0.85
mutableBodyHashFunction · 0.85

Tested by

no test coverage detected