(t *testing.T)
| 202 | } |
| 203 | |
| 204 | func TestRepoNetworkUnmarshalsDatabaseID(t *testing.T) { |
| 205 | httpReg := &httpmock.Registry{} |
| 206 | defer httpReg.Verify(t) |
| 207 | |
| 208 | httpReg.Register( |
| 209 | httpmock.GraphQL(`query RepositoryNetwork\b`), |
| 210 | httpmock.StringResponse(` |
| 211 | { "data": { |
| 212 | "viewer": {"login": "OWNER"}, |
| 213 | "repo_000": { |
| 214 | "id": "REPOID", |
| 215 | "databaseId": 1234, |
| 216 | "name": "REPO", |
| 217 | "owner": {"login": "OWNER"}, |
| 218 | "viewerPermission": "WRITE", |
| 219 | "defaultBranchRef": {"name": "main"} |
| 220 | } |
| 221 | } }`)) |
| 222 | |
| 223 | result, err := RepoNetwork(newTestClient(httpReg), []ghrepo.Interface{ghrepo.New("OWNER", "REPO")}) |
| 224 | require.NoError(t, err) |
| 225 | require.Len(t, result.Repositories, 1) |
| 226 | assert.Equal(t, int64(1234), result.Repositories[0].DatabaseID) |
| 227 | } |
| 228 | |
| 229 | func TestIssueRepoInfo_notFound(t *testing.T) { |
| 230 | httpReg := &httpmock.Registry{} |
nothing calls this directly
no test coverage detected