-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathserver_groups_default_test.go
More file actions
81 lines (72 loc) · 1.59 KB
/
server_groups_default_test.go
File metadata and controls
81 lines (72 loc) · 1.59 KB
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
// Code generated by go generate; DO NOT EDIT.
package brightbox
import (
"path"
"testing"
"time"
"gotest.tools/v3/assert"
)
func TestServerGroups(t *testing.T) {
instance := testAll(
t,
(*Client).ServerGroups,
"ServerGroup",
"server_groups",
"ServerGroups",
)
assert.Equal(t, instance.ID, "grp-sda44")
}
func TestServerGroup(t *testing.T) {
instance := testInstance(
t,
(*Client).ServerGroup,
"ServerGroup",
path.Join("server_groups", "grp-sda44"),
"server_group",
"grp-sda44",
)
assert.Equal(t, instance.ID, "grp-sda44")
}
func TestCreateServerGroup(t *testing.T) {
newResource := ServerGroupOptions{}
instance := testModify(
t,
(*Client).CreateServerGroup,
newResource,
"server_group",
"POST",
path.Join("server_groups"),
"{}",
)
assert.Equal(t, instance.ID, "grp-sda44")
}
func TestUpdateServerGroup(t *testing.T) {
updatedResource := ServerGroupOptions{ID: "grp-sda44"}
instance := testModify(
t,
(*Client).UpdateServerGroup,
updatedResource,
"server_group",
"PUT",
path.Join("server_groups", updatedResource.ID),
"{}",
)
assert.Equal(t, instance.ID, updatedResource.ID)
}
func TestDestroyServerGroup(t *testing.T) {
deletedResource := testModify(
t,
(*Client).DestroyServerGroup,
"grp-sda44",
"server_group",
"DELETE",
path.Join("server_groups", "grp-sda44"),
"",
)
assert.Equal(t, deletedResource.ID, "grp-sda44")
}
func TestServerGroupCreatedAtUnix(t *testing.T) {
tm := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC)
target := ServerGroup{CreatedAt: &tm}
assert.Equal(t, target.CreatedAtUnix(), tm.Unix())
}