replace fmt by logrus
This commit is contained in:
parent
f8d0f10c78
commit
e05afeeee5
@ -2,7 +2,6 @@ package clair
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
@ -54,7 +53,6 @@ func TestRelativeCount(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
vulnerabilitiesCount := allVulnerabilities(analysis)
|
vulnerabilitiesCount := allVulnerabilities(analysis)
|
||||||
fmt.Printf("v: %v\n", vulnerabilitiesCount)
|
|
||||||
if vulnerabilitiesCount.RelativeCount("High") != 1.3 {
|
if vulnerabilitiesCount.RelativeCount("High") != 1.3 {
|
||||||
t.Errorf("analysis.CountAllVulnerabilities().RelativeCount(\"High\") => %v, want 1.3", vulnerabilitiesCount.RelativeCount("High"))
|
t.Errorf("analysis.CountAllVulnerabilities().RelativeCount(\"High\") => %v, want 1.3", vulnerabilitiesCount.RelativeCount("High"))
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@ package clair
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
@ -24,8 +23,6 @@ func TestReportAsHtml(t *testing.T) {
|
|||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println(os.TempDir() + "/clairctl-html-report.html")
|
|
||||||
|
|
||||||
err = ioutil.WriteFile(os.TempDir()+"/clairctl-html-report.html", []byte(html), 0700)
|
err = ioutil.WriteFile(os.TempDir()+"/clairctl-html-report.html", []byte(html), 0700)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
@ -35,7 +32,6 @@ func TestReportAsHtml(t *testing.T) {
|
|||||||
func TestInvertedPriorities(t *testing.T) {
|
func TestInvertedPriorities(t *testing.T) {
|
||||||
expected := []types.Priority{types.Defcon1, types.Critical, types.High, types.Medium, types.Low, types.Negligible, types.Unknown}
|
expected := []types.Priority{types.Defcon1, types.Critical, types.High, types.Medium, types.Low, types.Negligible, types.Unknown}
|
||||||
ip := invertedPriorities()
|
ip := invertedPriorities()
|
||||||
fmt.Printf("%v - %v", len(expected), len(ip))
|
|
||||||
for i, v := range ip {
|
for i, v := range ip {
|
||||||
if v != expected[i] {
|
if v != expected[i] {
|
||||||
t.Errorf("Expecting %v, got %v", expected, ip)
|
t.Errorf("Expecting %v, got %v", expected, ip)
|
||||||
|
Loading…
Reference in New Issue
Block a user