added test case for exists object in put request

This commit is contained in:
Evgeniy Kulikov 2020-04-10 11:30:45 +03:00
parent d499971218
commit acfb16d363
No known key found for this signature in database
GPG key ID: BF6AEE0A2A699BF2
2 changed files with 10 additions and 7 deletions

View file

@ -17,6 +17,7 @@ func TestRequest(t *testing.T) {
&GetRangeRequest{},
&GetRangeHashRequest{},
MakePutRequestHeader(nil, nil),
MakePutRequestHeader(&Object{}, nil),
}
types := []RequestType{
@ -28,12 +29,13 @@ func TestRequest(t *testing.T) {
RequestRange,
RequestRangeHash,
RequestPut,
RequestPut,
}
for i := range cases {
v := cases[i]
t.Run(fmt.Sprintf("%T", v), func(t *testing.T) {
t.Run(fmt.Sprintf("%T_%d", v, i), func(t *testing.T) {
require.NotPanics(t, func() { v.CID() })
require.Equal(t, types[i], v.Type())
})