(self, credentials: BundleCredentials)
| 6 | |
| 7 | class GoogleSearch(BundleHandler): |
| 8 | async def verify(self, credentials: BundleCredentials): |
| 9 | |
| 10 | query: str = "today's google doodle" |
| 11 | api_key: str = credentials.credentials.get("GOOGLE_CUSTOM_SEARCH_API_KEY") |
| 12 | engine_id: str = credentials.credentials.get("GOOGLE_CUSTOM_SEARCH_ENGINE_ID") |
| 13 | |
| 14 | url = f"https://www.googleapis.com/customsearch/v1?key={api_key}&cx={engine_id}&q={query}" |
| 15 | |
| 16 | async with ClientSession() as session: |
| 17 | async with session.get(url=url, proxy=CONFIG.PROXY) as response: |
| 18 | if response.status == 200: |
| 19 | pass |
| 20 | else: |
| 21 | raise_credentials_validation_error() |
nothing calls this directly
no test coverage detected