-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcontrol_test.go
82 lines (77 loc) · 1.71 KB
/
control_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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
package assumer
import (
"reflect"
"testing"
"github.com/aws/aws-sdk-go/service/sts"
)
func TestControlPlane_Assume(t *testing.T) {
type fields struct {
Plane Plane
SerialNumber string
MfaToken string
}
tests := []struct {
name string
fields fields
want *sts.AssumeRoleOutput
wantErr bool
}{
// TODO: Add test cases.
}
for _, tt := range tests {
c := &ControlPlane{
Plane: tt.fields.Plane,
SerialNumber: tt.fields.SerialNumber,
MfaToken: tt.fields.MfaToken,
}
got, err := c.Assume()
if (err != nil) != tt.wantErr {
t.Errorf("%q. ControlPlane.Assume() error = %v, wantErr %v", tt.name, err, tt.wantErr)
continue
}
if !reflect.DeepEqual(got, tt.want) {
t.Errorf("%q. ControlPlane.Assume() = %v, want %v", tt.name, got, tt.want)
}
}
}
func TestControlPlane_GetDefaults(t *testing.T) {
type fields struct {
Plane Plane
SerialNumber string
MfaToken string
}
tests := []struct {
name string
fields fields
wantErr bool
}{
// TODO: Add test cases.
}
for _, tt := range tests {
c := &ControlPlane{
Plane: tt.fields.Plane,
SerialNumber: tt.fields.SerialNumber,
MfaToken: tt.fields.MfaToken,
}
if err := c.GetDefaults(); (err != nil) != tt.wantErr {
t.Errorf("%q. ControlPlane.GetDefaults() error = %v, wantErr %v", tt.name, err, tt.wantErr)
}
}
}
func TestCheckMfa(t *testing.T) {
type args struct {
token string
}
tests := []struct {
name string
args args
wantErr bool
}{
// TODO: Add test cases.
}
for _, tt := range tests {
if err := CheckMfa(tt.args.token); (err != nil) != tt.wantErr {
t.Errorf("%q. CheckMfa() error = %v, wantErr %v", tt.name, err, tt.wantErr)
}
}
}