Main page of booking platform can be reached

This commit is contained in:
Stanislas Jouffroy 2024-02-11 15:50:46 +01:00
parent 190d4d2a4b
commit 95e313d922
7 changed files with 571 additions and 3 deletions

View file

@ -0,0 +1,22 @@
import logging
from aiohttp import ClientSession, ClientResponse
LOGGER = logging.getLogger(__name__)
class GestionSportsConnector:
def __init__(self, url: str):
LOGGER.info("Initializing connection to GestionSports API")
self.url = url
self.session = ClientSession()
def __exit__(self, exc_type, exc_val, exc_tb):
self.session.close()
async def connect(self) -> ClientResponse:
LOGGER.info("Connecting to GestionSports API")
async with self.session.get(self.url) as response:
await response.text()
return response