-
Notifications
You must be signed in to change notification settings - Fork 112
Expand file tree
/
Copy pathauth_test.go
More file actions
46 lines (37 loc) · 1015 Bytes
/
auth_test.go
File metadata and controls
46 lines (37 loc) · 1015 Bytes
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
package verbose
import (
"fmt"
"github.com/deis/deis/tests/integration-utils"
"testing"
)
func authSetup(t *testing.T) *AuthData {
_ := itutils.GlobalSetup(t)
ucfg := itutils.SetUser()
fmt.Println("username :" + ucfg.UserName)
fmt.Println("password :" + ucfg.Password)
return &ucfg
}
func authRegisterTest(t *testing.T, params *AuthData) {
cmd := itutils.GetCommand("auth", "register")
itutils.Execute(t, cmd, params, false)
itutils.Execute(t, cmd, params, true)
}
func authLoginTest(t *testing.T, params *AuthData) {
cmd := itutils.GetCommand("auth", "login")
itutils.Execute(t, cmd, params, false)
params = authSetup(t)
itutils.Execute(t, cmd, params, true)
}
func authLogoutTest(t *testing.T, params *AuthData) {
cmd := itutils.GetCommand("auth", "logout")
itutils.Execute(t, cmd, params, false)
}
func authCancel() {
fmt.Println("coming soon")
}
func TestAuth(t *testing.T) {
params := authSetup(t)
authRegisterTest(t, params)
authLogoutTest(t, params)
authLoginTest(t, params)
}