mirror of
https://github.com/kubescape/kubescape.git
synced 2026-04-15 06:58:11 +00:00
assert instead of if else check on tests
Signed-off-by: cbrom <kb.cbrom@gmail.com>
This commit is contained in:
@@ -144,9 +144,7 @@ func TestValidate(t *testing.T) {
|
||||
for _, test := range tests {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
res := test.in.Validate()
|
||||
if test.expected != res {
|
||||
t.Errorf("wrong validation status: %v", res)
|
||||
}
|
||||
assert.Equal(t, test.expected, res)
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -194,9 +192,7 @@ func TestCalculateFixed(t *testing.T) {
|
||||
for _, test := range tests {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
res := CalculateFixed(test.in)
|
||||
if test.expected != res {
|
||||
t.Errorf("wrong fix status: %v", res)
|
||||
}
|
||||
assert.Equal(t, test.expected, res)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user