forked from intel/cve-bin-tool
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: John Andersen <[email protected]>
- Loading branch information
Showing
15 changed files
with
162 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import pytest | ||
import unittest | ||
|
||
from cve_bin_tool.parsers.parse import valid_files as actual_valid_files | ||
from cve_bin_tool.parsers.dart import DartParser | ||
from cve_bin_tool.parsers.go import GoParser | ||
from cve_bin_tool.parsers.java import JavaParser | ||
from cve_bin_tool.parsers.javascript import JavascriptParser | ||
from cve_bin_tool.parsers.perl import PerlParser | ||
from cve_bin_tool.parsers.php import PhpParser | ||
from cve_bin_tool.parsers.python import PythonParser, PythonRequirementsParser | ||
from cve_bin_tool.parsers.r import RParser | ||
from cve_bin_tool.parsers.ruby import RubyParser | ||
from cve_bin_tool.parsers.rust import RustParser | ||
from cve_bin_tool.parsers.swift import SwiftParser | ||
|
||
|
||
EXPECTED_VALID_FILES = { | ||
"pom.xml": [JavaParser], | ||
"package-lock.json": [JavascriptParser], | ||
"Cargo.lock": [RustParser], | ||
"renv.lock": [RParser], | ||
"requirements.txt": [PythonRequirementsParser], | ||
"go.mod": [GoParser], | ||
"PKG-INFO: ": [PythonParser], | ||
"METADATA: ": [PythonParser], | ||
"Gemfile.lock": [RubyParser], | ||
"Package.resolved": [SwiftParser], | ||
"composer.lock": [PhpParser], | ||
"cpanfile": [PerlParser], | ||
"pubspec.lock": [DartParser], | ||
} | ||
|
||
|
||
class TestParsers: | ||
@pytest.mark.asyncio | ||
async def test_parser_match_filenames_results_in_correct_valid_files(self): | ||
unittest.TestCase().assertDictEqual( | ||
EXPECTED_VALID_FILES, | ||
actual_valid_files, | ||
"Expected registered file types not the same as loaded file types, second dict is actual file types loaded, first is expected", | ||
) |