Skip to content

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
J08nY committed Nov 20, 2024
1 parent f5ce1a5 commit 25f8962
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/sec_certs/dataset/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ def filter_condition(cpe: CPE) -> bool:
return False
if re.match(constants.RELEASE_CANDIDATE_REGEX, cpe.update):
return False
return cpe in WINDOWS_WEAK_CPES
return cpe not in WINDOWS_WEAK_CPES

if not self.auxiliary_datasets.cpe_dset:
self.auxiliary_datasets.cpe_dset = self._prepare_cpe_dataset()
Expand Down
4 changes: 3 additions & 1 deletion tests/data/cc/analysis/cc_full_dataset.json
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,9 @@
]
},
"direct_transitive_cves": null,
"indirect_transitive_cves": null
"indirect_transitive_cves": null,
"next_certificates": null,
"prev_certificates": null
}
}
]
Expand Down
12 changes: 9 additions & 3 deletions tests/data/cc/analysis/reference_dataset.json
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,9 @@
]
},
"direct_transitive_cves": null,
"indirect_transitive_cves": null
"indirect_transitive_cves": null,
"next_certificates": null,
"prev_certificates": null
}
},
{
Expand Down Expand Up @@ -1224,7 +1226,9 @@
]
},
"direct_transitive_cves": null,
"indirect_transitive_cves": null
"indirect_transitive_cves": null,
"next_certificates": null,
"prev_certificates": null
}
},
{
Expand Down Expand Up @@ -1864,7 +1868,9 @@
]
},
"direct_transitive_cves": null,
"indirect_transitive_cves": null
"indirect_transitive_cves": null,
"next_certificates": null,
"prev_certificates": null
}
}
]
Expand Down
12 changes: 9 additions & 3 deletions tests/data/cc/analysis/transitive_vulnerability_dataset.json
Original file line number Diff line number Diff line change
Expand Up @@ -1334,7 +1334,9 @@
"elements": [
"CVE-2013-5385"
]
}
},
"next_certificates": null,
"prev_certificates": null
}
},
{
Expand Down Expand Up @@ -2283,7 +2285,9 @@
"elements": [
"CVE-2013-5385"
]
}
},
"next_certificates": null,
"prev_certificates": null
}
},
{
Expand Down Expand Up @@ -3634,7 +3638,9 @@
]
},
"direct_transitive_cves": null,
"indirect_transitive_cves": null
"indirect_transitive_cves": null,
"next_certificates": null,
"prev_certificates": null
}
}
]
Expand Down
8 changes: 6 additions & 2 deletions tests/data/cc/analysis/vulnerable_dataset.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@
"verified_cpe_matches": null,
"related_cves": null,
"cert_lab": null,
"cert_id": null
"cert_id": null,
"next_certificates": null,
"prev_certificates": null
}
},
{
Expand Down Expand Up @@ -173,7 +175,9 @@
"verified_cpe_matches": null,
"related_cves": null,
"cert_lab": null,
"cert_id": null
"cert_id": null,
"next_certificates": null,
"prev_certificates": null
}
}
]
Expand Down
2 changes: 2 additions & 0 deletions tests/data/cc/certificate/fictional_cert.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@
"extracted_sars": null,
"direct_transitive_cves": null,
"indirect_transitive_cves": null,
"next_certificates": null,
"prev_certificates": null,
"report_references": {
"_type": "sec_certs.sample.certificate.References",
"directly_referenced_by": null,
Expand Down
6 changes: 6 additions & 0 deletions tests/data/cc/dataset/toy_dataset.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@
"extracted_sars": null,
"direct_transitive_cves": null,
"indirect_transitive_cves": null,
"next_certificates": null,
"prev_certificates": null,
"report_references": {
"_type": "sec_certs.sample.certificate.References",
"directly_referenced_by": null,
Expand Down Expand Up @@ -208,6 +210,8 @@
"extracted_sars": null,
"direct_transitive_cves": null,
"indirect_transitive_cves": null,
"next_certificates": null,
"prev_certificates": null,
"report_references": {
"_type": "sec_certs.sample.certificate.References",
"directly_referenced_by": null,
Expand Down Expand Up @@ -324,6 +328,8 @@
"extracted_sars": null,
"direct_transitive_cves": null,
"indirect_transitive_cves": null,
"next_certificates": null,
"prev_certificates": null,
"report_references": {
"_type": "sec_certs.sample.certificate.References",
"directly_referenced_by": null,
Expand Down

0 comments on commit 25f8962

Please sign in to comment.