mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-08-07 11:58:32 +00:00
Vendor using dep
This commit is contained in:
40
vendor/github.com/google/go-github/github/apps_test.go
generated
vendored
Normal file
40
vendor/github.com/google/go-github/github/apps_test.go
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
// Copyright 2016 The go-github AUTHORS. All rights reserved.
|
||||
//
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package github
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"reflect"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestAppsService_ListInstallations(t *testing.T) {
|
||||
setup()
|
||||
defer teardown()
|
||||
|
||||
mux.HandleFunc("/app/installations", func(w http.ResponseWriter, r *http.Request) {
|
||||
testMethod(t, r, "GET")
|
||||
testHeader(t, r, "Accept", mediaTypeIntegrationPreview)
|
||||
testFormValues(t, r, values{
|
||||
"page": "1",
|
||||
"per_page": "2",
|
||||
})
|
||||
fmt.Fprint(w, `[{"id":1}]`)
|
||||
})
|
||||
|
||||
opt := &ListOptions{Page: 1, PerPage: 2}
|
||||
installations, _, err := client.Apps.ListInstallations(context.Background(), opt)
|
||||
if err != nil {
|
||||
t.Errorf("Apps.ListInstallations returned error: %v", err)
|
||||
}
|
||||
|
||||
want := []*Installation{{ID: Int(1)}}
|
||||
if !reflect.DeepEqual(installations, want) {
|
||||
t.Errorf("Apps.ListInstallations returned %+v, want %+v", installations, want)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user