mockIssueGetWithRepository stubs the issue lookup with a body and the two repository fields the uploader reads. A row states both, so an empty permission is a value a row can ask for.
(reg *httpmock.Registry, body string, databaseID int64, viewerPermission string)
| 1841 | // repository fields the uploader reads. A row states both, so an empty |
| 1842 | // permission is a value a row can ask for. |
| 1843 | func mockIssueGetWithRepository(reg *httpmock.Registry, body string, databaseID int64, viewerPermission string) { |
| 1844 | reg.Register( |
| 1845 | httpmock.GraphQL(`query IssueByNumber\b`), |
| 1846 | httpmock.StringResponse(fmt.Sprintf(` |
| 1847 | { "data": { "repository": { "hasIssuesEnabled": true, "issue": { |
| 1848 | "id": "123", |
| 1849 | "number": 123, |
| 1850 | "url": "https://github.com/OWNER/REPO/issue/123", |
| 1851 | "body": %s, |
| 1852 | "repository": { "databaseId": %d, "viewerPermission": %s } |
| 1853 | } } } }`, strconv.Quote(body), databaseID, strconv.Quote(viewerPermission))), |
| 1854 | ) |
| 1855 | } |
| 1856 | |
| 1857 | func mockIssueNumberGet(_ *testing.T, reg *httpmock.Registry, number int) { |
| 1858 | reg.Register( |
no test coverage detected