-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfleek_test.go
51 lines (42 loc) · 803 Bytes
/
fleek_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
46
47
48
49
50
51
package fleek
import (
"fmt"
"os"
"testing"
)
func TestGetSitesByTeamId(t *testing.T) {
f, err := New(os.Getenv("FLEEK_API_TOKEN"))
if err != nil {
t.Fatalf("%s", err)
}
sites, err := f.GetSitesByTeamId("mrusme-team")
if err != nil {
t.Fatalf("%s", err)
}
for _, site := range sites {
fmt.Printf(
"Site ID: %v\nName: %s\nPlatform: %s\nUpdated at: %s\n\n",
site.Id,
site.Name,
site.Platform,
site.UpdatedAt,
)
}
}
func TestGetSiteBySlug(t *testing.T) {
f, err := New(os.Getenv("FLEEK_API_TOKEN"))
if err != nil {
t.Fatalf("%s", err)
}
site, err := f.GetSiteBySlug("xn-gckvb8fzb")
if err != nil {
t.Fatalf("%s", err)
}
fmt.Printf(
"Site ID: %v\nName: %s\nPlatform: %s\nTeam ID: %v\n\n",
site.Id,
site.Name,
site.Platform,
site.Team.Id,
)
}