pip compatible server to serve Python packages out of GitHub
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

39 lines
995 B

// 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 (
"fmt"
"net/http"
"reflect"
"testing"
)
func TestIntegrationService_ListInstallations(t *testing.T) {
setup()
defer teardown()
mux.HandleFunc("/integration/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.Integrations.ListInstallations(opt)
if err != nil {
t.Errorf("Integration.ListInstallations returned error: %v", err)
}
want := []*Installation{{ID: Int(1)}}
if !reflect.DeepEqual(installations, want) {
t.Errorf("Integration.ListInstallations returned %+v, want %+v", installations, want)
}
}