forked from TrueCloudLab/frostfs-node
[#203] node: Resolve never used errors
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
e21c5bea21
commit
bab11492ad
3 changed files with 9 additions and 2 deletions
|
@ -50,6 +50,11 @@ func TestDB_Delete(t *testing.T) {
|
||||||
err = metaInhume(db, object.AddressOf(child), object.AddressOf(ts))
|
err = metaInhume(db, object.AddressOf(child), object.AddressOf(ts))
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
ts = testutil.GenerateObjectWithCID(cnr)
|
||||||
|
|
||||||
|
err = metaInhume(db, object.AddressOf(parent), object.AddressOf(ts))
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
// delete object
|
// delete object
|
||||||
err = metaDelete(db, object.AddressOf(child))
|
err = metaDelete(db, object.AddressOf(child))
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
@ -62,11 +67,11 @@ func TestDB_Delete(t *testing.T) {
|
||||||
// check if they marked as already removed
|
// check if they marked as already removed
|
||||||
|
|
||||||
ok, err := metaExists(db, object.AddressOf(child))
|
ok, err := metaExists(db, object.AddressOf(child))
|
||||||
require.Error(t, apistatus.ObjectAlreadyRemoved{})
|
require.ErrorAs(t, err, &apistatus.ObjectAlreadyRemoved{})
|
||||||
require.False(t, ok)
|
require.False(t, ok)
|
||||||
|
|
||||||
ok, err = metaExists(db, object.AddressOf(parent))
|
ok, err = metaExists(db, object.AddressOf(parent))
|
||||||
require.Error(t, apistatus.ObjectAlreadyRemoved{})
|
require.ErrorAs(t, err, &apistatus.ObjectAlreadyRemoved{})
|
||||||
require.False(t, ok)
|
require.False(t, ok)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -181,6 +181,7 @@ func TestDB_Exists(t *testing.T) {
|
||||||
require.ErrorIs(t, err, meta.ErrObjectIsExpired)
|
require.ErrorIs(t, err, meta.ErrObjectIsExpired)
|
||||||
|
|
||||||
gotObj, err = metaExists(db, object.AddressOf(nonExp))
|
gotObj, err = metaExists(db, object.AddressOf(nonExp))
|
||||||
|
require.NoError(t, err)
|
||||||
require.True(t, gotObj)
|
require.True(t, gotObj)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -225,6 +225,7 @@ func testForestTreeDrop(t *testing.T, s Forest) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
list, err := s.TreeList(cid)
|
list, err := s.TreeList(cid)
|
||||||
|
require.NoError(t, err)
|
||||||
require.NotEmpty(t, list)
|
require.NotEmpty(t, list)
|
||||||
|
|
||||||
require.NoError(t, s.TreeDrop(cid, ""))
|
require.NoError(t, s.TreeDrop(cid, ""))
|
||||||
|
|
Loading…
Reference in a new issue