New session now expects a struct with everything it needs and a context (#228)
to pass along
This commit is contained in:
committed by
Marcos Nils
parent
08f1ead2a9
commit
da6a55fb5c
@@ -1,6 +1,7 @@
|
||||
package pwd
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@@ -45,7 +46,8 @@ func TestClientNew(t *testing.T) {
|
||||
|
||||
playground := &types.Playground{Id: "foobar"}
|
||||
|
||||
session, err := p.SessionNew(playground, "", time.Hour, "", "", "")
|
||||
sConfig := types.SessionConfig{Playground: playground, UserId: "", Duration: time.Hour, Stack: "", StackName: "", ImageName: ""}
|
||||
session, err := p.SessionNew(context.Background(), sConfig)
|
||||
assert.Nil(t, err)
|
||||
|
||||
client := p.ClientNew("foobar", session)
|
||||
@@ -85,7 +87,8 @@ func TestClientCount(t *testing.T) {
|
||||
p.generator = _g
|
||||
playground := &types.Playground{Id: "foobar"}
|
||||
|
||||
session, err := p.SessionNew(playground, "", time.Hour, "", "", "")
|
||||
sConfig := types.SessionConfig{Playground: playground, UserId: "", Duration: time.Hour, Stack: "", StackName: "", ImageName: ""}
|
||||
session, err := p.SessionNew(context.Background(), sConfig)
|
||||
assert.Nil(t, err)
|
||||
|
||||
p.ClientNew("foobar", session)
|
||||
@@ -127,7 +130,8 @@ func TestClientResizeViewPort(t *testing.T) {
|
||||
p.generator = _g
|
||||
playground := &types.Playground{Id: "foobar"}
|
||||
|
||||
session, err := p.SessionNew(playground, "", time.Hour, "", "", "")
|
||||
sConfig := types.SessionConfig{Playground: playground, UserId: "", Duration: time.Hour, Stack: "", StackName: "", ImageName: ""}
|
||||
session, err := p.SessionNew(context.Background(), sConfig)
|
||||
assert.Nil(t, err)
|
||||
client := p.ClientNew("foobar", session)
|
||||
_s.On("ClientFindBySessionId", "aaaabbbbcccc").Return([]*types.Client{client}, nil)
|
||||
|
||||
Reference in New Issue
Block a user