frostfs-node/pkg/local_object_storage/metabase/v2/inhume_test.go
Alex Vanin 54cd91adff [#199] Simplify tests
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-12-11 17:19:37 +03:00

30 lines
678 B
Go

package meta_test
import (
"testing"
meta "github.com/nspcc-dev/neofs-node/pkg/local_object_storage/metabase/v2"
"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 := db.Put(raw.Object(), nil)
require.NoError(t, err)
err = db.Inhume(raw.Object().Address(), tombstoneID)
require.NoError(t, err)
_, err = db.Exists(raw.Object().Address())
require.EqualError(t, err, meta.ErrAlreadyRemoved.Error())
_, err = db.Get(raw.Object().Address())
require.EqualError(t, err, meta.ErrAlreadyRemoved.Error())
}