forked from TrueCloudLab/frostfs-node
590745204c
All parameters and resulting values of all metabase operations are structured in new types. The most popular scenarios for using operations are moved to auxiliary functions. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
31 lines
747 B
Go
31 lines
747 B
Go
package meta_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/core/object"
|
|
meta "github.com/nspcc-dev/neofs-node/pkg/local_object_storage/metabase"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestDB_Inhume(t *testing.T) {
|
|
db := newDB(t)
|
|
defer releaseDB(db)
|
|
|
|
raw := generateRawObject(t)
|
|
addAttribute(raw, "foo", "bar")
|
|
|
|
tombstoneID := generateAddress()
|
|
|
|
err := putBig(db, raw.Object())
|
|
require.NoError(t, err)
|
|
|
|
err = meta.Inhume(db, raw.Object().Address(), tombstoneID)
|
|
require.NoError(t, err)
|
|
|
|
_, err = meta.Exists(db, raw.Object().Address())
|
|
require.EqualError(t, err, object.ErrAlreadyRemoved.Error())
|
|
|
|
_, err = meta.Get(db, raw.Object().Address())
|
|
require.EqualError(t, err, object.ErrAlreadyRemoved.Error())
|
|
}
|