forked from cloudfoundry/go-cfclient
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildpacks_test.go
33 lines (28 loc) · 886 Bytes
/
buildpacks_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package cfclient
import (
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func TestListBuildpacks(t *testing.T) {
Convey("List buildpack", t, func() {
mocks := []MockRoute{
{"GET", "/v2/buildpacks", ListBuildpacksPayload, "", 200, "", nil},
{"GET", "/v2/buildpacksPage2", ListBuildpacksPayload2, "", 200, "", nil},
}
setupMultiple(mocks, t)
defer teardown()
c := &Config{
ApiAddress: server.URL,
Token: "foobar",
}
client, err := NewClient(c)
So(err, ShouldBeNil)
buildpacks, err := client.ListBuildpacks()
So(err, ShouldBeNil)
So(len(buildpacks), ShouldEqual, 6)
So(buildpacks[0].Guid, ShouldEqual, "c92b6f5f-d2a4-413a-b515-647d059723aa")
So(buildpacks[0].CreatedAt, ShouldEqual, "2016-06-08T16:41:31Z")
So(buildpacks[0].UpdatedAt, ShouldEqual, "2016-06-08T16:41:26Z")
So(buildpacks[0].Name, ShouldEqual, "name_1")
})
}