(t *testing.T)
| 422 | } |
| 423 | |
| 424 | func Test_getVariables_pagination(t *testing.T) { |
| 425 | reg := &httpmock.Registry{} |
| 426 | defer reg.Verify(t) |
| 427 | reg.Register( |
| 428 | httpmock.QueryMatcher("GET", "path/to", url.Values{"per_page": []string{"100"}}), |
| 429 | httpmock.WithHeader( |
| 430 | httpmock.StringResponse(`{"variables":[{},{}]}`), |
| 431 | "Link", |
| 432 | `<http://example.com/page/0>; rel="previous", <http://example.com/page/2>; rel="next"`), |
| 433 | ) |
| 434 | reg.Register( |
| 435 | httpmock.REST("GET", "page/2"), |
| 436 | httpmock.StringResponse(`{"variables":[{},{}]}`), |
| 437 | ) |
| 438 | client := &http.Client{Transport: reg} |
| 439 | variables, err := getVariables(client, "github.com", "path/to") |
| 440 | assert.NoError(t, err) |
| 441 | assert.Equal(t, 4, len(variables)) |
| 442 | } |
| 443 | |
| 444 | func TestExportVariables(t *testing.T) { |
| 445 | ios, _, stdout, _ := iostreams.Test() |
nothing calls this directly
no test coverage detected