add tests case to prevent npe

This commit is contained in:
Evgeniy Kulikov 2020-03-16 18:34:56 +03:00
parent eab0a26cc0
commit ea0703e089
No known key found for this signature in database
GPG key ID: BF6AEE0A2A699BF2

28
object/service_test.go Normal file
View file

@ -0,0 +1,28 @@
package object
import (
"fmt"
"testing"
"github.com/stretchr/testify/require"
)
func TestRequest(t *testing.T) {
cases := []Request{
&PutRequest{},
&GetRequest{},
&HeadRequest{},
&SearchRequest{},
&DeleteRequest{},
&GetRangeRequest{},
&GetRangeHashRequest{},
}
for i := range cases {
v := cases[i]
t.Run(fmt.Sprintf("%T", v), func(t *testing.T) {
require.NotPanics(t, func() { v.CID() })
})
}
}