Skip to content

Commit

Permalink
exclude path [.git] appended
Browse files Browse the repository at this point in the history
  • Loading branch information
imsahil007 committed Aug 21, 2020
1 parent 116ce95 commit 3df7f87
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from cve_bin_tool.cli import main
from cve_bin_tool.cvedb import DISK_LOCATION_DEFAULT
from cve_bin_tool.extractor import Extractor
from cve_bin_tool.version_scanner import VersionScanner
from .utils import (
TempDirTest,
download_file,
Expand Down Expand Up @@ -60,7 +61,7 @@ def test_exclude(self, caplog):
""" Test that the exclude paths are not scanned """
test_path = os.path.abspath(os.path.dirname(__file__))
exclude_path = os.path.join(test_path, "assets/")
checkers = ["curl", "libcurl", "kerberos", "kerberos_5"]
checkers = list(VersionScanner().checkers.keys())
with caplog.at_level(logging.INFO):
main(["cve-bin-tool", test_path, "-e", ",".join(exclude_path)])
self.check_exclude_log(caplog, exclude_path, checkers)
Expand Down Expand Up @@ -116,7 +117,7 @@ def check_exclude_log(caplog, exclude_path, checkers):
final_log = [
record for record in caplog.records if "NewFound CVEs" in record.message
]
assert len(final_log) == 0, "CVEs from excluded path scanned!!"
assert len(final_log) == 0, "Checkers from excluded path scanned!!"
if final_log:
final_log = final_log[0].message
for checker in checkers:
Expand Down

0 comments on commit 3df7f87

Please sign in to comment.