-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathapi_clients_default_test.go
More file actions
87 lines (78 loc) · 1.59 KB
/
api_clients_default_test.go
File metadata and controls
87 lines (78 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
82
83
84
85
86
87
// Code generated by go generate; DO NOT EDIT.
package brightbox
import (
"path"
"testing"
"gotest.tools/v3/assert"
)
func TestAPIClients(t *testing.T) {
instance := testAll(
t,
(*Client).APIClients,
"APIClient",
"api_clients",
"APIClients",
)
assert.Equal(t, instance.ID, "cli-dsse2")
}
func TestAPIClient(t *testing.T) {
instance := testInstance(
t,
(*Client).APIClient,
"APIClient",
path.Join("api_clients", "cli-dsse2"),
"api_client",
"cli-dsse2",
)
assert.Equal(t, instance.ID, "cli-dsse2")
}
func TestCreateAPIClient(t *testing.T) {
newResource := APIClientOptions{}
instance := testModify(
t,
(*Client).CreateAPIClient,
newResource,
"api_client",
"POST",
path.Join("api_clients"),
"{}",
)
assert.Equal(t, instance.ID, "cli-dsse2")
}
func TestUpdateAPIClient(t *testing.T) {
updatedResource := APIClientOptions{ID: "cli-dsse2"}
instance := testModify(
t,
(*Client).UpdateAPIClient,
updatedResource,
"api_client",
"PUT",
path.Join("api_clients", updatedResource.ID),
"{}",
)
assert.Equal(t, instance.ID, updatedResource.ID)
}
func TestDestroyAPIClient(t *testing.T) {
deletedResource := testModify(
t,
(*Client).DestroyAPIClient,
"cli-dsse2",
"api_client",
"DELETE",
path.Join("api_clients", "cli-dsse2"),
"",
)
assert.Equal(t, deletedResource.ID, "cli-dsse2")
}
func TestResetAPIClientPassword(t *testing.T) {
instance := testModify(
t,
(*Client).ResetAPIClientPassword,
"cli-dsse2",
"api_client",
"POST",
path.Join("api_clients", "cli-dsse2", "reset_secret"),
"",
)
assert.Equal(t, instance.ID, "cli-dsse2")
}