"""Tests for scrape component.""" from __future__ import annotations from typing import Any def return_integration_config( *, authentication=None, username=None, password=None, headers=None, sensors=None, ) -> dict[str, dict[str, Any]]: """Return config.""" config = { "resource": "https://www.home-assistant.io", "verify_ssl": True, "sensor": sensors, } if authentication: config["authentication"] = authentication if username: config["username"] = username config["password"] = password if headers: config["headers"] = headers return config class MockRestData: """Mock RestData.""" def __init__( self, payload, ) -> None: """Init RestDataMock.""" self.data: str | None = None self.payload = payload self.count = 0 async def async_update(self, data: bool | None = True) -> None: """Update.""" self.count += 1 if self.payload == "test_scrape_sensor": self.data = ( # Default "
" "Trying to get" "