8000 Fix kbmsr2019 importer by TG1999 · Pull Request #1158 · aboutcode-org/vulnerablecode · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix kbmsr2019 importer #1158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions vulnerabilities/importers/project_kb_msr2019.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from vulnerabilities.importer import AdvisoryData
from vulnerabilities.importer import Importer
from vulnerabilities.importer import Reference
from vulnerabilities.utils import fetch_and_read_from_csv
from vulnerabilities.utils import is_cve

# Reading CSV file from a url using `requests` is bit too complicated.
Expand Down
8 changes: 8 additions & 0 deletions vulnerabilities/tests/test_msr2019.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import csv
import os
from unittest import mock

from vulnerabilities.importers.project_kb_msr2019 import ProjectKBMSRImporter
from vulnerabilities.tests import util_tests
Expand All @@ -17,6 +18,13 @@
TEST_DIR = os.path.join(BASE_DIR, "test_data/kbmsr2019")


@mock.patch("vulnerabilities.importers.project_kb_msr2019.fetch_and_read_from_csv")
def test_data_fetch(mock_value):
importer = ProjectKBMSRImporter()
mock_value.return_value = []
importer.advisory_data()


def test_kbmsr_to_advisories():
TEST_DATA = os.path.join(TEST_DIR, "test_msr_data.csv")
with open(TEST_DATA) as f:
Expand Down
0