object: Add test for object request type

This commit is contained in:
alexvanin 2020-04-02 15:05:48 +03:00
parent 1e513625f1
commit 55b75a0dae

View file

@ -18,11 +18,22 @@ func TestRequest(t *testing.T) {
&GetRangeHashRequest{}, &GetRangeHashRequest{},
} }
types := []RequestType{
RequestPut,
RequestGet,
RequestHead,
RequestSearch,
RequestDelete,
RequestRange,
RequestRangeHash,
}
for i := range cases { for i := range cases {
v := cases[i] v := cases[i]
t.Run(fmt.Sprintf("%T", v), func(t *testing.T) { t.Run(fmt.Sprintf("%T", v), func(t *testing.T) {
require.NotPanics(t, func() { v.CID() }) require.NotPanics(t, func() { v.CID() })
require.Equal(t, types[i], v.Type())
}) })
} }
} }