[#203] node: Resolve never used errors

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2023-04-03 16:53:55 +03:00
parent e21c5bea21
commit bab11492ad
3 changed files with 9 additions and 2 deletions

View file

@ -50,6 +50,11 @@ func TestDB_Delete(t *testing.T) {
err = metaInhume(db, object.AddressOf(child), object.AddressOf(ts))
require.NoError(t, err)
ts = testutil.GenerateObjectWithCID(cnr)
err = metaInhume(db, object.AddressOf(parent), object.AddressOf(ts))
require.NoError(t, err)
// delete object
err = metaDelete(db, object.AddressOf(child))
require.NoError(t, err)
@ -62,11 +67,11 @@ func TestDB_Delete(t *testing.T) {
// check if they marked as already removed
ok, err := metaExists(db, object.AddressOf(child))
require.Error(t, apistatus.ObjectAlreadyRemoved{})
require.ErrorAs(t, err, &apistatus.ObjectAlreadyRemoved{})
require.False(t, ok)
ok, err = metaExists(db, object.AddressOf(parent))
require.Error(t, apistatus.ObjectAlreadyRemoved{})
require.ErrorAs(t, err, &apistatus.ObjectAlreadyRemoved{})
require.False(t, ok)
}

View file

@ -181,6 +181,7 @@ func TestDB_Exists(t *testing.T) {
require.ErrorIs(t, err, meta.ErrObjectIsExpired)
gotObj, err = metaExists(db, object.AddressOf(nonExp))
require.NoError(t, err)
require.True(t, gotObj)
})
})

View file

@ -225,6 +225,7 @@ func testForestTreeDrop(t *testing.T, s Forest) {
}
}
list, err := s.TreeList(cid)
require.NoError(t, err)
require.NotEmpty(t, list)
require.NoError(t, s.TreeDrop(cid, ""))