forked from TrueCloudLab/frostfs-s3-gw
[#306] Add test to check empty policy
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
parent
76042f6728
commit
d532eb710f
1 changed files with 18 additions and 0 deletions
|
@ -2,9 +2,12 @@ package handler
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"mime/multipart"
|
||||
"net/http"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/nspcc-dev/neofs-s3-gw/api"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
|
@ -86,3 +89,18 @@ func TestCustomJSONMarshal(t *testing.T) {
|
|||
|
||||
require.Equal(t, expectedPolicy, policy)
|
||||
}
|
||||
|
||||
func TestEmptyPostPolicy(t *testing.T) {
|
||||
r := &http.Request{
|
||||
MultipartForm: &multipart.Form{
|
||||
Value: map[string][]string{
|
||||
"key": {"some-key"},
|
||||
},
|
||||
},
|
||||
}
|
||||
reqInfo := &api.ReqInfo{}
|
||||
metadata := make(map[string]string)
|
||||
|
||||
_, err := checkPostPolicy(r, reqInfo, metadata)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue