-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathaccounts_default_test.go
67 lines (59 loc) · 1.25 KB
/
accounts_default_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
// Code generated by go generate; DO NOT EDIT.
package brightbox
import (
"path"
"testing"
"time"
"gotest.tools/v3/assert"
)
func TestAccounts(t *testing.T) {
instance := testAll(
t,
(*Client).Accounts,
"Account",
"accounts",
"Accounts",
)
assert.Equal(t, instance.ID, "acc-43ks4")
}
func TestAccount(t *testing.T) {
instance := testInstance(
t,
(*Client).Account,
"Account",
path.Join("accounts", "acc-43ks4"),
"account",
"acc-43ks4",
)
assert.Equal(t, instance.ID, "acc-43ks4")
}
func TestUpdateAccount(t *testing.T) {
updatedResource := AccountOptions{ID: "acc-43ks4"}
instance := testModify(
t,
(*Client).UpdateAccount,
updatedResource,
"account",
"PUT",
path.Join("accounts", updatedResource.ID),
"{}",
)
assert.Equal(t, instance.ID, updatedResource.ID)
}
func TestAccountCreatedAtUnix(t *testing.T) {
tm := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC)
target := Account{CreatedAt: &tm}
assert.Equal(t, target.CreatedAtUnix(), tm.Unix())
}
func TestResetAccountPassword(t *testing.T) {
instance := testModify(
t,
(*Client).ResetAccountPassword,
"acc-43ks4",
"account",
"POST",
path.Join("accounts", "acc-43ks4", "reset_ftp_password"),
"",
)
assert.Equal(t, instance.ID, "acc-43ks4")
}