-
Notifications
You must be signed in to change notification settings - Fork 151
/
Copy pathcustom_config_get_test.go
88 lines (79 loc) · 2.24 KB
/
custom_config_get_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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
package object_test
import (
"testing"
"github.com/scaleway/scaleway-cli/v2/core"
"github.com/scaleway/scaleway-cli/v2/internal/namespaces/object/v1"
"github.com/scaleway/scaleway-sdk-go/scw"
"github.com/stretchr/testify/require"
)
func Test_ConfigGet(t *testing.T) {
client, err := scw.NewClient(
scw.WithAuth(
"SCWXXXXXXXXXXXXXXXXX",
"11111111-1111-1111-1111-111111111111",
),
scw.WithDefaultOrganizationID("11111111-1111-1111-1111-111111111111"),
scw.WithDefaultProjectID("11111111-1111-1111-1111-111111111111"),
scw.WithDefaultZone(scw.ZoneFrPar1),
scw.WithDefaultRegion(scw.RegionFrPar),
)
require.NoError(t, err)
t.Run("Default", func(t *testing.T) {
t.Run("rclone", core.Test(&core.TestConfig{
Commands: object.GetCommands(),
Cmd: "scw object config get type=rclone",
Check: core.TestCheckCombine(
core.TestCheckGolden(),
core.TestCheckExitCode(0),
),
Client: client,
}))
t.Run("mc", core.Test(&core.TestConfig{
Commands: object.GetCommands(),
Cmd: "scw object config get type=mc",
Check: core.TestCheckCombine(
core.TestCheckGolden(),
core.TestCheckExitCode(0),
),
Client: client,
}))
t.Run("s3cmd", core.Test(&core.TestConfig{
Commands: object.GetCommands(),
Cmd: "scw object config get type=s3cmd",
Check: core.TestCheckCombine(
core.TestCheckGolden(),
core.TestCheckExitCode(0),
),
Client: client,
}))
})
t.Run("With region", func(t *testing.T) {
t.Run("rclone", core.Test(&core.TestConfig{
Commands: object.GetCommands(),
Cmd: "scw object config get type=rclone region=nl-ams",
Check: core.TestCheckCombine(
core.TestCheckGolden(),
core.TestCheckExitCode(0),
),
Client: client,
}))
t.Run("mc", core.Test(&core.TestConfig{
Commands: object.GetCommands(),
Cmd: "scw object config get type=mc region=nl-ams",
Check: core.TestCheckCombine(
core.TestCheckGolden(),
core.TestCheckExitCode(0),
),
Client: client,
}))
t.Run("s3cmd", core.Test(&core.TestConfig{
Commands: object.GetCommands(),
Cmd: "scw object config get type=s3cmd region=nl-ams",
Check: core.TestCheckCombine(
core.TestCheckGolden(),
core.TestCheckExitCode(0),
),
Client: client,
}))
})
}