fix unit test
This commit is contained in:
parent
89b8fbfdcc
commit
61a0673550
2 changed files with 8 additions and 0 deletions
|
|
@ -20,6 +20,8 @@ var runCmd = &cobra.Command{
|
|||
Short: L("Execute process"),
|
||||
Long: L("Execute process"),
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
share.SessionServerStart() // Connect to session server
|
||||
defer share.SessionServerStop() // Connect to session server
|
||||
defer gou.KillPlugins()
|
||||
defer func() {
|
||||
err := exception.Catch(recover())
|
||||
|
|
|
|||
|
|
@ -4,10 +4,16 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/yaoapp/yao/share"
|
||||
"github.com/yaoapp/yao/user"
|
||||
)
|
||||
|
||||
func TestUserAuth(t *testing.T) {
|
||||
|
||||
// Start Session Server
|
||||
share.SessionServerStart()
|
||||
defer share.SessionServerStop()
|
||||
|
||||
res := user.Auth("email", "xiang@iqka.com", "A123456p+")
|
||||
assert.True(t, res.Has("user"))
|
||||
assert.True(t, res.Has("token"))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue