Makes error store allow update if error only on get

This commit is contained in:
Deepak Mallubhotla 2021-01-17 11:13:29 -06:00
parent 169afed5c9
commit 2a3d789292
Signed by: deepak
GPG Key ID: 64BF53A3369104E7
2 changed files with 6 additions and 1 deletions

View File

@ -21,7 +21,10 @@ func (e *errorStore) InsertAction(action *models.Action) (int, error) {
}
func (e *errorStore) UpdateAction(action *models.Action) error {
return e.error
if e.errorOnInsert {
return e.error
}
return nil
}
func (e *errorStore) SelectPlans() ([]*models.Plan, error) {

View File

@ -31,6 +31,8 @@ func TestErrorActionMethods(t *testing.T) {
replacementAction := &models.Action{}
err = str.UpdateAction(replacementAction)
assert.NotNil(err)
err = str2.UpdateAction(replacementAction)
assert.Nil(err)
}