Skip to content

Commit

Permalink
Merge pull request #26 from aquasecurity/liamg-granular-policy-failures
Browse files Browse the repository at this point in the history
Fix failing test
  • Loading branch information
liamg authored Dec 21, 2021
2 parents 2d05d67 + c1ace27 commit fb94d95
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions test/process_results_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ func Test_process_results_with_no_results(t *testing.T) {

client := FakeClient{}

results, policyFailures := processor.ProcessResults(client, nil)
results := processor.ProcessResults(client, nil)
assert.Nil(t, results)
assert.Nil(t, policyFailures)

}

Expand Down Expand Up @@ -44,10 +43,9 @@ func Test_process_results_with_results_but_not_matching_policies(t *testing.T) {
},
}

submitResults, summaries := processor.ProcessResults(client, results)
submitResults := processor.ProcessResults(client, results)

assert.Len(t, submitResults, 1)
assert.Len(t, summaries, 1)
}

func Test_process_results_with_results_with_matching_policies(t *testing.T) {
Expand All @@ -74,10 +72,9 @@ func Test_process_results_with_results_with_matching_policies(t *testing.T) {
},
}

submitResults, summaries := processor.ProcessResults(client, results)
submitResults := processor.ProcessResults(client, results)

assert.Len(t, submitResults, 1)
assert.NotNil(t, summaries)
}

func Test_process_results_with_results_with_no_matching_policies_severity_level(t *testing.T) {
Expand All @@ -104,10 +101,9 @@ func Test_process_results_with_results_with_no_matching_policies_severity_level(
},
}

submitResults, summaries := processor.ProcessResults(client, results)
submitResults := processor.ProcessResults(client, results)

assert.Len(t, submitResults, 1)
assert.Len(t, summaries, 1)
}

func Test_process_results_with_results_with_matching_policies_severity_level(t *testing.T) {
Expand All @@ -134,10 +130,9 @@ func Test_process_results_with_results_with_matching_policies_severity_level(t *
},
}

submitResults, policyFailures := processor.ProcessResults(client, results)
submitResults := processor.ProcessResults(client, results)

assert.Len(t, submitResults, 1)
assert.NotNil(t, policyFailures)
}

func Test_process_results_with_results_with_matching_policies_severity_level_greater_than_specified(t *testing.T) {
Expand All @@ -164,8 +159,7 @@ func Test_process_results_with_results_with_matching_policies_severity_level_gre
},
}

submitResults, policyFailures := processor.ProcessResults(client, results)
submitResults := processor.ProcessResults(client, results)

assert.Len(t, submitResults, 1)
assert.NotNil(t, policyFailures)
}

0 comments on commit fb94d95

Please sign in to comment.