forked from shuheiktgw/go-travis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmessages_integration_test.go
42 lines (32 loc) · 1.04 KB
/
messages_integration_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
34
35
36
37
38
39
40
41
42
// Copyright (c) 2015 Ableton AG, Berlin. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build integration
package travis
import (
"context"
"net/http"
"testing"
)
const integrationRequestId = 161917659
func TestMessagesService_Integration_ListByRepoId(t *testing.T) {
opt := MessagesOption{Limit: 5}
_, res, err := integrationClient.Messages.ListByRepoId(context.TODO(), integrationRepoId, integrationRequestId, &opt)
if err != nil {
t.Fatalf("unexpected error occured: %s", err)
}
if res.StatusCode != http.StatusOK {
t.Fatalf("invalid http status: %s", res.Status)
}
}
func TestMessagesService_Integration_ListByRepoSlug(t *testing.T) {
opt := MessagesOption{Limit: 5}
_, res, err := integrationClient.Messages.ListByRepoSlug(context.TODO(), integrationRepoSlug, integrationRequestId, &opt)
if err != nil {
t.Fatalf("unexpected error occured: %s", err)
}
if res.StatusCode != http.StatusOK {
t.Fatalf("invalid http status: %s", res.Status)
}
}