Improve tests
This commit is contained in:
parent
0ec493e7d8
commit
9324fa113d
@ -87,6 +87,7 @@ func (suite *URLCacheIntegrationSuite) TestURLCacheBasic() {
|
|||||||
newItem(newFolderName, true),
|
newItem(newFolderName, true),
|
||||||
control.Copy)
|
control.Copy)
|
||||||
require.NoError(t, err, clues.ToCore(err))
|
require.NoError(t, err, clues.ToCore(err))
|
||||||
|
|
||||||
require.NotNil(t, newFolder.GetId())
|
require.NotNil(t, newFolder.GetId())
|
||||||
|
|
||||||
nfid := ptr.Val(newFolder.GetId())
|
nfid := ptr.Val(newFolder.GetId())
|
||||||
@ -131,10 +132,7 @@ func (suite *URLCacheIntegrationSuite) TestURLCacheBasic() {
|
|||||||
nfid,
|
nfid,
|
||||||
newItem(newItemName, false),
|
newItem(newItemName, false),
|
||||||
control.Copy)
|
control.Copy)
|
||||||
if err != nil {
|
require.NoError(t, err, clues.ToCore(err))
|
||||||
// Something bad happened, skip this item
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
items = append(items, item)
|
items = append(items, item)
|
||||||
}
|
}
|
||||||
@ -176,13 +174,18 @@ func (suite *URLCacheIntegrationSuite) TestURLCacheBasic() {
|
|||||||
nil,
|
nil,
|
||||||
nil)
|
nil)
|
||||||
require.NoError(t, err, clues.ToCore(err))
|
require.NoError(t, err, clues.ToCore(err))
|
||||||
|
|
||||||
|
require.NotNil(t, resp)
|
||||||
|
require.NotNil(t, resp.Body)
|
||||||
require.Equal(t, http.StatusOK, resp.StatusCode)
|
require.Equal(t, http.StatusOK, resp.StatusCode)
|
||||||
|
|
||||||
|
resp.Body.Close()
|
||||||
}(i)
|
}(i)
|
||||||
}
|
}
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
|
|
||||||
// Validate that <= 1 delta queries were made by url cache
|
// Validate that exactly 1 delta query was made by url cache
|
||||||
require.LessOrEqual(t, uc.deltaQueryCount, 1)
|
require.Equal(t, 1, uc.deltaQueryCount)
|
||||||
}
|
}
|
||||||
|
|
||||||
type URLCacheUnitSuite struct {
|
type URLCacheUnitSuite struct {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user