Adds error store test for missing store
This commit is contained in:
parent
42d808165b
commit
f84c9b6ea2
@ -1,6 +1,7 @@
|
|||||||
package store_test
|
package store_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"gitea.deepak.science/deepak/gogmagog/models"
|
"gitea.deepak.science/deepak/gogmagog/models"
|
||||||
"gitea.deepak.science/deepak/gogmagog/store"
|
"gitea.deepak.science/deepak/gogmagog/store"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
@ -11,11 +12,14 @@ func TestErrorActionMethods(t *testing.T) {
|
|||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
str := store.GetErrorStore("error message sample", true)
|
str := store.GetErrorStore("error message sample", true)
|
||||||
str2 := store.GetErrorStore("error message sample", false)
|
str2 := store.GetErrorStore("error message sample", false)
|
||||||
|
str3 := store.GetErrorStoreForError(fmt.Errorf("test error"), false)
|
||||||
|
|
||||||
_, err := str.InsertAction(&models.Action{})
|
_, err := str.InsertAction(&models.Action{})
|
||||||
assert.NotNil(err)
|
assert.NotNil(err)
|
||||||
_, err = str2.InsertAction(&models.Action{})
|
_, err = str2.InsertAction(&models.Action{})
|
||||||
assert.Nil(err)
|
assert.Nil(err)
|
||||||
|
_, err = str3.InsertAction(&models.Action{})
|
||||||
|
assert.Nil(err)
|
||||||
|
|
||||||
_, err = str.SelectActionByID(8)
|
_, err = str.SelectActionByID(8)
|
||||||
assert.NotNil(err)
|
assert.NotNil(err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user