-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathaffinity_groups_test.go
60 lines (48 loc) · 1.31 KB
/
affinity_groups_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
package egoscale
import (
"net/url"
"testing"
)
func TestCreateAffinityGroup(t *testing.T) {
req := &CreateAffinityGroup{}
_ = req.Response().(*AsyncJobResult)
_ = req.AsyncResponse().(*AffinityGroup)
}
func TestDeleteAffinityGroup(t *testing.T) {
req := &DeleteAffinityGroup{}
_ = req.Response().(*AsyncJobResult)
_ = req.AsyncResponse().(*BooleanResponse)
}
func TestListAffinityGroups(t *testing.T) {
req := &ListAffinityGroups{}
_ = req.Response().(*ListAffinityGroupsResponse)
}
func TestListAffinityGroupTypes(t *testing.T) {
req := &ListAffinityGroupTypes{}
_ = req.Response().(*ListAffinityGroupTypesResponse)
}
func TestUpdateVMAffinityGroup(t *testing.T) {
req := &UpdateVMAffinityGroup{}
_ = req.Response().(*AsyncJobResult)
_ = req.AsyncResponse().(*VirtualMachine)
}
func TestCreateAffinityGroupOnBeforeSend(t *testing.T) {
req := &CreateAffinityGroup{}
params := url.Values{}
if err := req.onBeforeSend(params); err != nil {
t.Error(err)
}
if _, ok := params["name"]; !ok {
t.Errorf("name should have been set")
}
}
func TestUpdateVMOnBeforeSend(t *testing.T) {
req := &UpdateVMAffinityGroup{}
params := url.Values{}
if err := req.onBeforeSend(params); err != nil {
t.Error(err)
}
if _, ok := params["affinitygroupids"]; !ok {
t.Errorf("affinitygroupids should have been set")
}
}