frostfs-api-go/object/service_test.go

42 lines
660 B
Go
Raw Normal View History

2020-03-16 15:34:56 +00:00
package object
import (
"fmt"
"testing"
"github.com/stretchr/testify/require"
)
func TestRequest(t *testing.T) {
cases := []Request{
&PutRequest{},
&GetRequest{},
&HeadRequest{},
&SearchRequest{},
&DeleteRequest{},
&GetRangeRequest{},
&GetRangeHashRequest{},
MakePutRequestHeader(nil, nil),
2020-03-16 15:34:56 +00:00
}
types := []RequestType{
RequestPut,
RequestGet,
RequestHead,
RequestSearch,
RequestDelete,
RequestRange,
RequestRangeHash,
RequestPut,
}
2020-03-16 15:34:56 +00:00
for i := range cases {
v := cases[i]
t.Run(fmt.Sprintf("%T", v), func(t *testing.T) {
require.NotPanics(t, func() { v.CID() })
require.Equal(t, types[i], v.Type())
2020-03-16 15:34:56 +00:00
})
}
}