refactor: use testing DB instead of mock (#1234)

This commit is contained in:
Teppei Fukuda
2021-09-15 10:06:01 +03:00
committed by GitHub
parent d8cc8b550b
commit 31c45ffc52
34 changed files with 1186 additions and 1159 deletions

View File

@@ -40,7 +40,7 @@ func TestConvertToRpcPkgs(t *testing.T) {
SrcVersion: "1.2.3",
SrcRelease: "1",
SrcEpoch: 2,
License: "MIT",
License: "MIT",
},
},
},
@@ -55,7 +55,7 @@ func TestConvertToRpcPkgs(t *testing.T) {
SrcVersion: "1.2.3",
SrcRelease: "1",
SrcEpoch: 2,
License: "MIT",
License: "MIT",
},
},
},
@@ -90,7 +90,7 @@ func TestConvertFromRpcPkgs(t *testing.T) {
SrcVersion: "1.2.3",
SrcRelease: "1",
SrcEpoch: 2,
License: "MIT",
License: "MIT",
},
},
},
@@ -105,7 +105,7 @@ func TestConvertFromRpcPkgs(t *testing.T) {
SrcVersion: "1.2.3",
SrcRelease: "1",
SrcEpoch: 2,
License: "MIT",
License: "MIT",
},
},
},
@@ -329,7 +329,7 @@ func TestConvertFromRPCResults(t *testing.T) {
Title: "DoS",
Description: "Denial of Service",
Severity: common.Severity_MEDIUM,
SeveritySource: vulnerability.Nvd,
SeveritySource: vulnerability.NVD,
CweIds: []string{"CWE-123", "CWE-456"},
Cvss: map[string]*common.CVSS{
"redhat": {
@@ -365,7 +365,7 @@ func TestConvertFromRPCResults(t *testing.T) {
Digest: "sha256:154ad0735c360b212b167f424d33a62305770a1fcfb6363882f5c436cfbd9812",
DiffID: "sha256:b2a1a2d80bf0c747a4f6b0ca6af5eef23f043fcdb1ed4f3a3e750aef2dc68079",
},
SeveritySource: vulnerability.Nvd,
SeveritySource: vulnerability.NVD,
PrimaryURL: "https://avd.aquasec.com/nvd/CVE-2019-0001",
Vulnerability: dbTypes.Vulnerability{
Title: "DoS",
@@ -405,7 +405,7 @@ func TestConvertFromRPCResults(t *testing.T) {
Title: "DoS",
Description: "Denial of Service",
Severity: common.Severity_MEDIUM,
SeveritySource: vulnerability.Nvd,
SeveritySource: vulnerability.NVD,
CweIds: []string{"CWE-123", "CWE-456"},
Cvss: map[string]*common.CVSS{
"redhat": {
@@ -441,7 +441,7 @@ func TestConvertFromRPCResults(t *testing.T) {
Digest: "sha256:154ad0735c360b212b167f424d33a62305770a1fcfb6363882f5c436cfbd9812",
DiffID: "sha256:b2a1a2d80bf0c747a4f6b0ca6af5eef23f043fcdb1ed4f3a3e750aef2dc68079",
},
SeveritySource: vulnerability.Nvd,
SeveritySource: vulnerability.NVD,
PrimaryURL: "https://avd.aquasec.com/nvd/CVE-2019-0001",
Vulnerability: dbTypes.Vulnerability{
Title: "DoS",