-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_test.go
27 lines (21 loc) · 978 Bytes
/
main_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
package main
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestBuildArgsWithEndpoint(t *testing.T) {
command := buildArgs("127.0.0.1", "sync", "foo", "bar", "")
assert.Equal(t, []string{"s3", "--endpoint-url", "127.0.0.1", "sync", "foo", "bar"}, command)
}
func TestBuildArgsWithEndpointAndCP(t *testing.T) {
command := buildArgs("127.0.0.1", "cp", "foo", "bar", "")
assert.Equal(t, []string{"s3", "--endpoint-url", "127.0.0.1", "cp", "foo", "bar"}, command)
}
func TestBuildArgsdWithExcludes(t *testing.T) {
command := buildArgs("", "sync", "foo", "bar", "/stuff,/things")
assert.Equal(t, []string{"s3", "sync", "--exclude", "/stuff", "--exclude", "/things", "foo", "bar"}, command)
}
func TestBuildArgsWithAll(t *testing.T) {
command := buildArgs("127.0.0.1", "sync", "foo", "bar", "/stuff,/things")
assert.Equal(t, []string{"s3", "--endpoint-url", "127.0.0.1", "sync", "--exclude", "/stuff", "--exclude", "/things", "foo", "bar"}, command)
}