Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Patrik Cyvoct <[email protected]>
  • Loading branch information
Sh4d1 authored and remyleone committed May 12, 2020
1 parent bdcf196 commit aeb7817
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions internal/namespaces/registry/v1/custom_login_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,20 @@ import (

"github.com/alecthomas/assert"
"github.com/scaleway/scaleway-cli/internal/core"
"github.com/scaleway/scaleway-sdk-go/scw"
"github.com/stretchr/testify/require"
)

func Test_Login(t *testing.T) {
clientOpts := []scw.ClientOption{
scw.WithDefaultZone(scw.ZoneFrPar1),
scw.WithDefaultRegion(scw.RegionFrPar),
scw.WithAuth("SCWXXXXXXXXXXXXXXXXX", "11111111-1111-1111-1111-111111111111"),
}

client, err := scw.NewClient(clientOpts...)
require.NoError(t, err)

t.Run("docker", core.Test(&core.TestConfig{
Commands: GetCommands(),
Cmd: "scw registry login program=docker",
Expand All @@ -27,6 +37,7 @@ func Test_Login(t *testing.T) {
assert.Equal(t, secret, string(stdin))
return 0, nil
},
Client: client,
}))
t.Run("podman", core.Test(&core.TestConfig{
Commands: GetCommands(),
Expand All @@ -43,5 +54,6 @@ func Test_Login(t *testing.T) {
assert.Equal(t, secret, string(stdin))
return 0, nil
},
Client: client,
}))
}

0 comments on commit aeb7817

Please sign in to comment.