|
25 | 25 |
|
26 | 26 | from cve_bin_tool.checkers import __all__ as all_test_name
|
27 | 27 | from cve_bin_tool.cvedb import CVEDB
|
| 28 | +from cve_bin_tool.util import windows_fixup |
28 | 29 | from cve_bin_tool.version_scanner import VersionScanner
|
29 | 30 |
|
30 | 31 | # load test data
|
@@ -83,10 +84,6 @@ def teardown_class(cls):
|
83 | 84 | shutil.rmtree(cls.package_test_dir)
|
84 | 85 | shutil.rmtree(cls.mapping_test_dir)
|
85 | 86 |
|
86 |
| - def windows_fixup(self, filename): |
87 |
| - """Replace colon and backslash in filename to avoid a failure on Windows""" |
88 |
| - return filename.replace(":", "_").replace("\\", "_") |
89 |
| - |
90 | 87 | def test_false_positive(self):
|
91 | 88 | self.scanner.all_cves = []
|
92 | 89 | with tempfile.NamedTemporaryFile(
|
@@ -154,7 +151,7 @@ def test_version_mapping(self, product, version, version_strings):
|
154 | 151 | for filename in filenames:
|
155 | 152 | with tempfile.NamedTemporaryFile(
|
156 | 153 | "w+b",
|
157 |
| - suffix=self.windows_fixup(filename), |
| 154 | + suffix=windows_fixup(filename), |
158 | 155 | dir=self.mapping_test_dir,
|
159 | 156 | delete=False,
|
160 | 157 | ) as f:
|
@@ -237,7 +234,7 @@ def condensed_filepath(self, url, package_name):
|
237 | 234 | dirpath.mkdir()
|
238 | 235 | # Check if we've already made a condensed version of the file, if we
|
239 | 236 | # have, we're done.
|
240 |
| - condensed_path = condensed_dir / (self.windows_fixup(package_name) + ".tar.gz") |
| 237 | + condensed_path = condensed_dir / (windows_fixup(package_name) + ".tar.gz") |
241 | 238 | if condensed_path.is_file():
|
242 | 239 | return str(condensed_path)
|
243 | 240 | # Download the file if we don't have a condensed version of it and we
|
|
0 commit comments