|
15 | 15 | from pathlib import Path |
16 | 16 | from unittest.mock import MagicMock, call, patch |
17 | 17 |
|
| 18 | +from cve_bin_tool.log import LOGGER |
| 19 | + |
18 | 20 | from jsonschema import validate |
19 | 21 | from jsonschema.exceptions import ValidationError |
20 | 22 | from rich.console import Console |
@@ -1432,7 +1434,7 @@ def test_output_console_metrics_false(self): |
1432 | 1434 |
|
1433 | 1435 | def test_output_file(self): |
1434 | 1436 | """Test file generation logic in output_file""" |
1435 | | - logger = logging.getLogger() |
| 1437 | + logger = LOGGER |
1436 | 1438 |
|
1437 | 1439 | with self.assertLogs(logger, logging.INFO) as cm: |
1438 | 1440 | self.output_engine.output_file(output_type="json") |
@@ -1467,7 +1469,7 @@ def test_csv_output_file(self): |
1467 | 1469 |
|
1468 | 1470 | def test_output_file_wrapper(self): |
1469 | 1471 | """Test file generation logic in output_file_wrapper""" |
1470 | | - logger = logging.getLogger() |
| 1472 | + logger = LOGGER |
1471 | 1473 | self.output_engine.filename = "test-report" |
1472 | 1474 |
|
1473 | 1475 | with self.assertLogs(logger, logging.INFO) as cm: |
@@ -1507,7 +1509,7 @@ def test_output_file_filename_already_exists(self): |
1507 | 1509 | with open("testfile.csv", "w") as f: |
1508 | 1510 | f.write("testing") |
1509 | 1511 |
|
1510 | | - logger = logging.getLogger() |
| 1512 | + logger = LOGGER |
1511 | 1513 |
|
1512 | 1514 | # setup the context manager |
1513 | 1515 | with self.assertLogs(logger, logging.INFO) as cm: |
@@ -1545,7 +1547,7 @@ def test_output_file_incorrect_filename(self): |
1545 | 1547 | # update the filename in output_engine |
1546 | 1548 | self.output_engine.filename = "/not/a/good_filename" |
1547 | 1549 |
|
1548 | | - logger = logging.getLogger() |
| 1550 | + logger = LOGGER |
1549 | 1551 |
|
1550 | 1552 | # setup the context manager |
1551 | 1553 | with self.assertLogs(logger, logging.INFO) as cm: |
|
0 commit comments