forked from TrueCloudLab/frostfs-node
[#243] core/object: Replace test content of tombstone with an API structure
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
4f5d5c7e45
commit
510e9ff2ec
7 changed files with 30 additions and 234 deletions
|
@ -108,28 +108,25 @@ func TestFormatValidator_Validate(t *testing.T) {
|
|||
obj := NewRaw()
|
||||
obj.SetType(object.TypeTombstone)
|
||||
|
||||
require.Error(t, v.ValidateContent(obj.Object().SDK()))
|
||||
require.Error(t, v.ValidateContent(obj.Object()))
|
||||
|
||||
addr := object.NewAddress()
|
||||
content := object.NewTombstone()
|
||||
content.SetMembers([]*object.ID{nil})
|
||||
|
||||
content := NewTombstoneContent()
|
||||
content.SetAddressList(addr)
|
||||
|
||||
data, err := content.MarshalBinary()
|
||||
data, err := content.Marshal()
|
||||
require.NoError(t, err)
|
||||
|
||||
obj.SetPayload(data)
|
||||
|
||||
require.Error(t, v.ValidateContent(obj.Object().SDK()))
|
||||
require.Error(t, v.ValidateContent(obj.Object()))
|
||||
|
||||
addr.SetContainerID(testContainerID(t))
|
||||
addr.SetObjectID(testObjectID(t))
|
||||
content.SetMembers([]*object.ID{testObjectID(t)})
|
||||
|
||||
data, err = content.MarshalBinary()
|
||||
data, err = content.Marshal()
|
||||
require.NoError(t, err)
|
||||
|
||||
obj.SetPayload(data)
|
||||
|
||||
require.NoError(t, v.ValidateContent(obj.Object().SDK()))
|
||||
require.NoError(t, v.ValidateContent(obj.Object()))
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue