forked from SumoLogic/telegraf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
client_test.go
43 lines (34 loc) · 806 Bytes
/
client_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
package kube_inventory
import (
"testing"
"time"
"github.com/ericchiang/k8s/util/intstr"
"github.com/influxdata/telegraf/plugins/common/tls"
)
type mockHandler struct {
responseMap map[string]interface{}
}
func toStrPtr(s string) *string {
return &s
}
func toInt32Ptr(i int32) *int32 {
return &i
}
func toInt64Ptr(i int64) *int64 {
return &i
}
func toBoolPtr(b bool) *bool {
return &b
}
func toIntStrPtrS(s string) *intstr.IntOrString {
return &intstr.IntOrString{StrVal: &s}
}
func toIntStrPtrI(i int32) *intstr.IntOrString {
return &intstr.IntOrString{IntVal: &i}
}
func TestNewClient(t *testing.T) {
_, err := newClient("https://127.0.0.1:443/", "default", "abc123", time.Second, tls.ClientConfig{})
if err != nil {
t.Errorf("Failed to create new client - %s", err.Error())
}
}