diff --git a/vulnerabilities/importers/mozilla.py b/vulnerabilities/importers/mozilla.py index 52535693b..d3bbbd0c8 100644 --- a/vulnerabilities/importers/mozilla.py +++ b/vulnerabilities/importers/mozilla.py @@ -7,21 +7,21 @@ from markdown import markdown from packageurl import PackageURL -from vulnerabilities.data_source import Advisory -from vulnerabilities.data_source import GitDataSource -from vulnerabilities.data_source import Reference -from vulnerabilities.data_source import VulnerabilitySeverity +from vulnerabilities.importer import Advisory +from vulnerabilities.importer import GitImporter +from vulnerabilities.importer import Reference +from vulnerabilities.importer import VulnerabilitySeverity from vulnerabilities.helpers import is_cve from vulnerabilities.helpers import split_markdown_front_matter -from vulnerabilities.severity_systems import scoring_systems +from vulnerabilities.severity_systems import SCORING_SYSTEMS REPOSITORY = "mozilla/foundation-security-advisories" MFSA_FILENAME_RE = re.compile(r"mfsa(\d{4}-\d{2,3})\.(md|yml)$") -class MozillaDataSource(GitDataSource): +class MozillaImporter(GitImporter): def __enter__(self): - super(MozillaDataSource, self).__enter__() + super(MozillaImporter, self).__enter__() if not getattr(self, "_added_files", None): self._added_files, self._updated_files = self.file_changes( diff --git a/vulnerabilities/tests/test_mozilla.py b/vulnerabilities/tests/test_mozilla.py index 5d57fb0a5..83e7435bc 100644 --- a/vulnerabilities/tests/test_mozilla.py +++ b/vulnerabilities/tests/test_mozilla.py @@ -14,7 +14,7 @@ TEST_DATA = os.path.join(BASE_DIR, "test_data/") -@patch("vulnerabilities.importers.MozillaDataSource._update_from_remote") +@patch("vulnerabilities.importers.MozillaImporter._update_from_remote") class MozillaImportTest(TestCase): tempdir = None @@ -31,7 +31,7 @@ def setUpClass(cls) -> None: name="mozilla_unittests", license="", last_run=None, - data_source="MozillaDataSource", + data_source="MozillaImporter", data_source_cfg={ "repository_url": "https://example.git", "working_directory": os.path.join(cls.tempdir, "mozilla_test"), @@ -48,9 +48,9 @@ def tearDownClass(cls) -> None: def test_import(self, _): runner = ImportRunner(self.importer, 100) - # Remove if we don't need set_api in MozillaDataSource - # with patch("vulnerabilities.importers.MozillaDataSource.versions", new=MOCK_VERSION_API): - # with patch("vulnerabilities.importers.MozillaDataSource.set_api"): + # Remove if we don't need set_api in MozillaImporter + # with patch("vulnerabilities.importers.MozillaImporter.versions", new=MOCK_VERSION_API): + # with patch("vulnerabilities.importers.MozillaImporter.set_api"): # runner.run() runner.run()