Newer
Older
package nucleus
import (
"context"
"reflect"
"testing"
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
62
63
64
)
func TestRestconf_Get(t *testing.T) {
type args struct {
ctx context.Context
params []string
}
tests := []struct {
name string
args args
want interface{}
wantErr bool
}{
{name: "not implemented", args: args{}, want: nil, wantErr: true},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
r := Restconf{}
got, err := r.Get(tt.args.ctx, tt.args.params...)
if (err != nil) != tt.wantErr {
t.Errorf("Get() error = %v, wantErr %v", err, tt.wantErr)
return
}
if !reflect.DeepEqual(got, tt.want) {
t.Errorf("Get() got = %v, want %v", got, tt.want)
}
})
}
}
func TestRestconf_ProcessResponse(t *testing.T) {
type args struct {
resp interface{}
root interface{}
models *ytypes.Schema
}
tests := []struct {
name string
args args
wantErr bool
}{
{name: "not implemented", args: args{}, wantErr: true},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
r := Restconf{}
if err := r.ProcessResponse(tt.args.resp, tt.args.root, tt.args.models); (err != nil) != tt.wantErr {
t.Errorf("ProcessResponse() error = %v, wantErr %v", err, tt.wantErr)
}
})
}
}
func TestRestconf_Set(t *testing.T) {
type args struct {
ctx context.Context
}
tests := []struct {
name string
args args
wantErr bool
}{
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
r := Restconf{}
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
if (err != nil) != tt.wantErr {
t.Errorf("Set() error = %v, wantErr %v", err, tt.wantErr)
}
})
}
}
func TestRestconf_Subscribe(t *testing.T) {
type args struct {
ctx context.Context
params []string
}
tests := []struct {
name string
args args
wantErr bool
}{
{name: "not implemented", args: args{}, wantErr: true},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
r := Restconf{}
if err := r.Subscribe(tt.args.ctx, tt.args.params...); (err != nil) != tt.wantErr {
t.Errorf("Subscribe() error = %v, wantErr %v", err, tt.wantErr)
}
})
}
}
func TestRestconf_Type(t *testing.T) {
tests := []struct {
name string
want string
}{
{name: "not implemented", want: "restconf"},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
r := Restconf{}
if got := r.Type(); got != tt.want {
t.Errorf("Type() = %v, want %v", got, tt.want)
}
})
}
}