From 44376ee382e90fea0dd87911c8a338999a799713 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Tue, 23 Jul 2024 11:45:17 +0200 Subject: [PATCH] Added the print_error not called check in the `test_cmd_web_imports_playwright` method. --- tests/scrape/test_scrape.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/scrape/test_scrape.py b/tests/scrape/test_scrape.py index af41c0a8e..dac2cbaf6 100644 --- a/tests/scrape/test_scrape.py +++ b/tests/scrape/test_scrape.py @@ -13,6 +13,10 @@ class TestScrape(unittest.TestCase): self.commands = Commands(self.io, None) def test_cmd_web_imports_playwright(self): + # Create a mock print_error function + mock_print_error = MagicMock() + self.commands.io.tool_error = mock_print_error + # Run the cmd_web command result = self.commands.cmd_web("https://example.com") @@ -33,6 +37,9 @@ class TestScrape(unittest.TestCase): playwright_imported, "Playwright should be importable after running cmd_web" ) + # Assert that print_error was never called + mock_print_error.assert_not_called() + def test_scrape_actual_url_with_playwright(self): # Create a Scraper instance with a mock print_error function mock_print_error = MagicMock()