Skip to content

Commit

Permalink
test masked errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ObiWahn committed Mar 8, 2018
1 parent bf268cc commit ec41d32
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/util/k8sutil/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,21 @@ var (

func TestIsAlreadyExists(t *testing.T) {
assert.False(t, IsAlreadyExists(conflictError))
assert.False(t, IsConflict(maskAny(invalidError)))
assert.True(t, IsAlreadyExists(existsError))
assert.True(t, IsAlreadyExists(maskAny(existsError)))
}

func TestIsConflict(t *testing.T) {
assert.False(t, IsConflict(existsError))
assert.False(t, IsConflict(maskAny(invalidError)))
assert.True(t, IsConflict(conflictError))
assert.True(t, IsConflict(maskAny(conflictError)))
}

func TestIsNotFound(t *testing.T) {
assert.False(t, IsNotFound(invalidError))
assert.False(t, IsConflict(maskAny(invalidError)))
assert.True(t, IsNotFound(notFoundError))
assert.True(t, IsNotFound(maskAny(notFoundError)))
}

0 comments on commit ec41d32

Please sign in to comment.