Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Ensure we do have an error before testing it
Browse files Browse the repository at this point in the history
Signed-off-by: Sylvain Rabot <s.rabot@lectra.com>
  • Loading branch information
Sylvain Rabot committed Nov 28, 2018
1 parent 7cf913f commit a82add1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions pkg/api/vlabs/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1943,11 +1943,13 @@ func TestProperties_ValidateZones(t *testing.T) {
ExcludeMasterFromStandardLB: helpers.PointerToBool(test.excludeMasterFromStandardLB),
}

err := p.Validate(false)

expectedMsg := test.expectedErr
if err.Error() != expectedMsg {
t.Errorf("expected error with message : %s, but got : %s", expectedMsg, err.Error())
if err := p.Validate(false); err != nil {
expectedMsg := test.expectedErr
if err.Error() != expectedMsg {
t.Errorf("expected error with message : %s, but got : %s", expectedMsg, err.Error())
}
} else {
t.Errorf("error should have occurred")
}
})
}
Expand Down

0 comments on commit a82add1

Please sign in to comment.