Cloud migration: upload snapshot files using presigned url (#90273)
* Cloud migration: upload snapshot files using presigned url * log error if index file cannot be closed * log error if file cannot be closed in uploadUsingPresignedURL
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package gmsclient
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func Test_buildBasePath(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
tests := []struct {
|
||||
description string
|
||||
domain string
|
||||
clusterSlug string
|
||||
expected string
|
||||
}{
|
||||
{
|
||||
description: "domain starts with http://localhost, should return domain",
|
||||
domain: "http://localhost:8080",
|
||||
clusterSlug: "anything",
|
||||
expected: "http://localhost:8080",
|
||||
},
|
||||
{
|
||||
description: "domain doesn't start with http://localhost, should build a string using the domain and clusterSlug",
|
||||
domain: "gms-dev",
|
||||
clusterSlug: "us-east-1",
|
||||
expected: "https://cms-us-east-1.gms-dev/cloud-migrations",
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.description, func(t *testing.T) {
|
||||
assert.Equal(t, tt.expected, buildBasePath(tt.domain, tt.clusterSlug))
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user