-
Notifications
You must be signed in to change notification settings - Fork 0
/
api_test.go
45 lines (39 loc) · 929 Bytes
/
api_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
43
44
45
package circleci
import (
"testing"
"log"
"os"
)
var circle_ci_token = os.Getenv("circle_ci_token")
// Testcase for Me API
func TestMe(t *testing.T) {
user, err := Me(circle_ci_token)
if err != nil {
t.Error(err)
}
log.Println(user)
}
// Testcase for Me API
func TestProjects(t *testing.T) {
projects, err := Projects(circle_ci_token)
if err != nil {
t.Error(err)
}
log.Println(projects)
}
// Testcase for getting latest build for
func TestRecentBuildsFor(t *testing.T) {
builds, err := RecentBuildsFor(circle_ci_token, "betacraft", "droidcloud", 1, 0, "succesfull")
if err != nil {
t.Error(err)
}
log.Println(builds)
}
// Testcase for getting artifacts of a given build for a project
func TestGetArtifactsOfBuildNoForProject(t *testing.T) {
artifacts, err := GetArtifactsOfBuildNoForProject(circle_ci_token, "betacraft", "droidcloud", 68)
if err != nil {
t.Error(err)
}
log.Println(artifacts)
}