mirror of
https://github.com/rclone/rclone.git
synced 2025-12-21 10:43:37 +00:00
Switch to using the dep tool and update all the dependencies
This commit is contained in:
52
vendor/github.com/aws/aws-sdk-go/service/iotdataplane/customizations_test.go
generated
vendored
Normal file
52
vendor/github.com/aws/aws-sdk-go/service/iotdataplane/customizations_test.go
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
package iotdataplane_test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/awstesting/unit"
|
||||
"github.com/aws/aws-sdk-go/service/iotdataplane"
|
||||
)
|
||||
|
||||
func TestRequireEndpointIfRegionProvided(t *testing.T) {
|
||||
svc := iotdataplane.New(unit.Session, &aws.Config{
|
||||
Region: aws.String("mock-region"),
|
||||
DisableParamValidation: aws.Bool(true),
|
||||
})
|
||||
req, _ := svc.GetThingShadowRequest(nil)
|
||||
err := req.Build()
|
||||
|
||||
assert.Equal(t, "", svc.Endpoint)
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, aws.ErrMissingEndpoint, err)
|
||||
}
|
||||
|
||||
func TestRequireEndpointIfNoRegionProvided(t *testing.T) {
|
||||
svc := iotdataplane.New(unit.Session, &aws.Config{
|
||||
DisableParamValidation: aws.Bool(true),
|
||||
})
|
||||
fmt.Println(svc.ClientInfo.SigningRegion)
|
||||
|
||||
req, _ := svc.GetThingShadowRequest(nil)
|
||||
err := req.Build()
|
||||
|
||||
assert.Equal(t, "", svc.Endpoint)
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, aws.ErrMissingEndpoint, err)
|
||||
}
|
||||
|
||||
func TestRequireEndpointUsed(t *testing.T) {
|
||||
svc := iotdataplane.New(unit.Session, &aws.Config{
|
||||
Region: aws.String("mock-region"),
|
||||
DisableParamValidation: aws.Bool(true),
|
||||
Endpoint: aws.String("https://endpoint"),
|
||||
})
|
||||
req, _ := svc.GetThingShadowRequest(nil)
|
||||
err := req.Build()
|
||||
|
||||
assert.Equal(t, "https://endpoint", svc.Endpoint)
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
Reference in New Issue
Block a user