(self, credentials: BundleCredentials)
| 5 | |
| 6 | class ExchangerateApi(BundleHandler): |
| 7 | async def verify(self, credentials: BundleCredentials): |
| 8 | from_currency: str = "USD" |
| 9 | to_currency: str = "EUR" |
| 10 | exchangerate_api_key: str = credentials.credentials.get("EXCHANGERATE_API_API_KEY") |
| 11 | |
| 12 | base_url = f"https://v6.exchangerate-api.com/v6/{exchangerate_api_key}/pair/{from_currency}/{to_currency}" |
| 13 | |
| 14 | async with ClientSession() as session: |
| 15 | async with session.get(base_url) as response: |
| 16 | if response.status == 200: |
| 17 | pass |
| 18 | else: |
| 19 | raise_credentials_validation_error() |
| 20 |
nothing calls this directly
no test coverage detected