Skip to content

Commit

Permalink
tests: test deletion by name
Browse files Browse the repository at this point in the history
This tests issue WasabiAiR#210 - without the local-FS fix, it passes on
cloud file systems and fails on local, with the fix it also passes
on local.
  • Loading branch information
urisimchoni committed Jun 24, 2019
1 parent 093d490 commit 90a2423
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions test/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,9 @@ func All(t *testing.T, kind string, config stow.Config) {
is.OK(item3)

defer func() {
err := c1.RemoveItem(item1.ID())
is.NoErr(err)
err = c1.RemoveItem(item2.ID())
is.NoErr(err)
err = c1.RemoveItem(item3.ID())
is.NoErr(err)
c1.RemoveItem(item1.ID())
c1.RemoveItem(item2.ID())
c1.RemoveItem(item3.ID())
}()

// make sure we can get a small set of paginated results
Expand Down Expand Up @@ -287,6 +284,20 @@ func All(t *testing.T, kind string, config stow.Config) {
})
is.NoErr(err)
is.Equal(found, 3) // should find three items

//item removal by ID
err = c1.RemoveItem(item2.ID())
is.NoErr(err)
noItem, err = c1copy.Item(item2.ID())
is.Equal(stow.ErrNotFound, err)
is.Nil(noItem)

//item removal by name
err = c1.RemoveItem(item1Name)
is.NoErr(err)
noItem, err = c1copy.Item(item1.ID())
is.Equal(stow.ErrNotFound, err)
is.Nil(noItem)
}

func totalNetFDs(t *testing.T) (int, []byte) {
Expand Down

0 comments on commit 90a2423

Please sign in to comment.