aider/tests/scrape/test_scrape.py

34 lines
845 B
Python

import unittest
from unittest.mock import patch
import sys
import io
from aider.commands import Commands
from aider.io import InputOutput
class TestScrape(unittest.TestCase):
def setUp(self):
self.io = InputOutput()
self.commands = Commands(self.io, None)
def test_cmd_web_imports_playwright(self):
# Run the cmd_web command
self.commands.cmd_web("https://example.com")
# Try to import playwright
try:
import playwright
playwright_imported = True
except ImportError:
playwright_imported = False
# Assert that playwright was successfully imported
self.assertTrue(
playwright_imported,
"Playwright should be importable after running cmd_web"
)
if __name__ == "__main__":
unittest.main()