-
Notifications
You must be signed in to change notification settings - Fork 9
/
api_health_test.go
61 lines (49 loc) · 1.19 KB
/
api_health_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
52
53
54
55
56
57
58
59
60
61
package blockfrost_test
import (
"context"
"path/filepath"
"reflect"
"strings"
"testing"
"github.com/blockfrost/blockfrost-go"
)
func TestResourceInfoIntegration(t *testing.T) {
t.Parallel()
api := blockfrost.NewAPIClient(
blockfrost.APIClientOptions{},
)
got, err := api.Info(context.TODO())
if err != nil {
t.Fatal(err)
}
fp := filepath.Join(testdata, strings.ToLower(strings.TrimPrefix(t.Name(), "Test"))+".golden")
want := blockfrost.Info{}
testIntUtil(t, fp, &got, &want)
}
func TestResourceHealthIntegration(t *testing.T) {
t.Parallel()
api := blockfrost.NewAPIClient(
blockfrost.APIClientOptions{},
)
got, err := api.Health(context.TODO())
if err != nil {
t.Fatal(err)
}
want := blockfrost.Health{}
fp := filepath.Join(testdata, strings.ToLower(strings.TrimPrefix(t.Name(), "Test"))+".golden")
testIntUtil(t, fp, &got, &want)
}
func TestResourceHealthClockIntegration(t *testing.T) {
t.Parallel()
api := blockfrost.NewAPIClient(
blockfrost.APIClientOptions{},
)
got, err := api.HealthClock(context.TODO())
if err != nil {
t.Fatal(err)
}
nullGot := blockfrost.HealthClock{}
if reflect.DeepEqual(got, nullGot) {
t.Fatalf("got null healthclock, %+v", got)
}
}