Skip to content

Commit 136d758

Browse files
committed
Update importer mock test #597
Reference: #935 Signed-off-by: John M. Horan <[email protected]>
1 parent cce5f23 commit 136d758

File tree

3 files changed

+307750
-4
lines changed

3 files changed

+307750
-4
lines changed

vulnerabilities/importers/archlinux.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def fetch(self) -> Iterable[Mapping]:
3636

3737
def advisory_data(self) -> Iterable[AdvisoryData]:
3838
for record in self.fetch():
39-
yield self.parse_advisory(record)
39+
yield from self.parse_advisory(record)
4040

4141
def parse_advisory(self, record) -> List[AdvisoryData]:
4242
advisories = []

vulnerabilities/tests/test_archlinux.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,11 @@ def test_parse_advisory_single():
4343
util_tests.check_results_against_json(result, expected_file)
4444

4545

46-
@patch("vulnerabilities.importers.archlinux.ArchlinuxImporter.fetch")
46+
@patch("vulnerabilities.utils.fetch_response")
4747
def test_archlinux_importer(mock_response):
4848
with open(os.path.join(TEST_DATA, "archlinux-multi.json")) as f:
4949
mock_response.return_value = json.load(f)
5050

5151
expected_file = os.path.join(TEST_DATA, f"archlinux-multi-expected.json")
5252
result = [data.to_dict() for data in list(archlinux.ArchlinuxImporter().advisory_data())]
53-
# result = [data.to_dict() for data in archlinux.ArchlinuxImporter().advisory_data()]
54-
# result = archlinux.ArchlinuxImporter().advisory_data()
5553
util_tests.check_results_against_json(result, expected_file)

0 commit comments

Comments
 (0)