created a gestion sports services class that handles the connection while the connector is dedicated to the requests
This commit is contained in:
parent
bcd8dc0733
commit
e6023e0687
12 changed files with 513 additions and 593 deletions
|
@ -4,6 +4,7 @@ from pathlib import Path
|
|||
import pendulum
|
||||
import pytest
|
||||
from connectors import GestionSportsConnector
|
||||
from gestion_sports_services import GestionSportsServices
|
||||
from models import (
|
||||
BookingFilter,
|
||||
BookingOpening,
|
||||
|
@ -184,6 +185,11 @@ def connector(club) -> GestionSportsConnector:
|
|||
return GestionSportsConnector(club)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def gs_services() -> GestionSportsServices:
|
||||
return GestionSportsServices()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def user() -> User:
|
||||
return User(login="padel.testing@jouf.fr", password="ridicule")
|
||||
|
@ -226,6 +232,22 @@ def booking_failure_response() -> dict:
|
|||
return json.loads(booking_failure_file.read_text(encoding="utf-8"))
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def booked_courts_response(
|
||||
court11,
|
||||
court12,
|
||||
court13,
|
||||
court14,
|
||||
booking_success_response,
|
||||
booking_failure_response,
|
||||
) -> list[tuple[int, dict]]:
|
||||
court1_resp = court11.id, booking_failure_response
|
||||
court2_resp = court12.id, booking_failure_response
|
||||
court3_resp = court13.id, booking_success_response
|
||||
court4_resp = court14.id, booking_failure_response
|
||||
return [court1_resp, court2_resp, court3_resp, court4_resp]
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def booking_success_from_start(
|
||||
landing_response,
|
||||
|
@ -350,3 +372,8 @@ def cancellation_success_booking_filter() -> BookingFilter:
|
|||
return BookingFilter(
|
||||
sport_name="Sport1", date=pendulum.parse("2024-03-21T13:30:00Z")
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def service() -> GestionSportsServices:
|
||||
return GestionSportsServices()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue