Replacing require.nil in plugin package (#16961)

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Jesús Espino
2021-03-09 09:45:00 +01:00
коммит произвёл GitHub
родитель 5a89208944
Коммит 857e18f3ab
5 изменённых файлов: 48 добавлений и 47 удалений

Просмотреть файл

@@ -438,7 +438,7 @@ func TestKVListWithOptions(t *testing.T) {
keys, err := p.KVListWithOptions()
api.AssertExpectations(t)
assert.Empty(t, keys)
assert.Nil(t, err)
assert.NoError(t, err)
})
t.Run("Basic Success, one page", func(t *testing.T) {
@@ -452,7 +452,7 @@ func TestKVListWithOptions(t *testing.T) {
keys, err := p.KVListWithOptions()
api.AssertExpectations(t)
assert.ElementsMatch(t, keys, []string{"key1", "key2"})
assert.Nil(t, err)
assert.NoError(t, err)
})
t.Run("Basic Success, two page", func(t *testing.T) {
@@ -467,7 +467,7 @@ func TestKVListWithOptions(t *testing.T) {
keys, err := p.KVListWithOptions()
api.AssertExpectations(t)
assert.ElementsMatch(t, keys, getKeys(101))
assert.Nil(t, err)
assert.NoError(t, err)
})
t.Run("error on second page", func(t *testing.T) {
@@ -497,7 +497,7 @@ func TestKVListWithOptions(t *testing.T) {
keys, err := p.KVListWithOptions(plugin.WithPrefix("key99"))
api.AssertExpectations(t)
assert.ElementsMatch(t, keys, []string{"key99"})
assert.Nil(t, err)
assert.NoError(t, err)
})
t.Run("success, two page, filter prefix, all", func(t *testing.T) {
@@ -512,7 +512,7 @@ func TestKVListWithOptions(t *testing.T) {
keys, err := p.KVListWithOptions(plugin.WithPrefix("notkey"))
api.AssertExpectations(t)
assert.Empty(t, keys)
assert.Nil(t, err)
assert.NoError(t, err)
})
t.Run("success, two page, filter prefix, none", func(t *testing.T) {
@@ -527,7 +527,7 @@ func TestKVListWithOptions(t *testing.T) {
keys, err := p.KVListWithOptions(plugin.WithPrefix("key"))
api.AssertExpectations(t)
assert.ElementsMatch(t, keys, getKeys(101))
assert.Nil(t, err)
assert.NoError(t, err)
})
t.Run("success, two page, checker func, one", func(t *testing.T) {
@@ -549,7 +549,7 @@ func TestKVListWithOptions(t *testing.T) {
keys, err := p.KVListWithOptions(plugin.WithChecker(check))
api.AssertExpectations(t)
assert.ElementsMatch(t, keys, []string{"key1"})
assert.Nil(t, err)
assert.NoError(t, err)
})
t.Run("success, two page, checker func, all", func(t *testing.T) {
@@ -568,7 +568,7 @@ func TestKVListWithOptions(t *testing.T) {
keys, err := p.KVListWithOptions(plugin.WithChecker(check))
api.AssertExpectations(t)
assert.Empty(t, keys)
assert.Nil(t, err)
assert.NoError(t, err)
})
t.Run("success, two page, checker func, none", func(t *testing.T) {
@@ -587,7 +587,7 @@ func TestKVListWithOptions(t *testing.T) {
keys, err := p.KVListWithOptions(plugin.WithChecker(check))
api.AssertExpectations(t)
assert.ElementsMatch(t, keys, getKeys(101))
assert.Nil(t, err)
assert.NoError(t, err)
})
t.Run("error, checker func", func(t *testing.T) {
@@ -626,7 +626,7 @@ func TestKVListWithOptions(t *testing.T) {
keys, err := p.KVListWithOptions(plugin.WithPrefix("key"), plugin.WithChecker(check))
api.AssertExpectations(t)
assert.ElementsMatch(t, keys, []string{"key2", "key4"})
assert.Nil(t, err)
assert.NoError(t, err)
})
}