Refactoring for reading the config
This commit is contained in:
parent
963ee6b86f
commit
fc11a1e1eb
9 changed files with 264 additions and 166 deletions
|
@ -2,20 +2,20 @@ import json
|
|||
|
||||
import pendulum
|
||||
import pytest
|
||||
from aiohttp import ClientSession
|
||||
|
||||
from resa_padel.gestion_sports.gestion_sports_connector import \
|
||||
GestionSportsConnector
|
||||
from resa_padel.gestion_sports.gestion_sports_payload_builder import \
|
||||
GestionSportsPayloadBuilder
|
||||
from resa_padel.models import BookingFilter, User
|
||||
from resa_padel.gestion_sports.gestion_sports_payload_builder import (
|
||||
GestionSportsPayloadBuilder,
|
||||
)
|
||||
from resa_padel.models import BookingFilter, Club, User
|
||||
|
||||
user = User(login="padel.testing@jouf.fr", password="ridicule", club_id="123")
|
||||
url = "https://tpc.padel.com"
|
||||
club = Club(id="123", url=url, courts_ids=[606, 607, 608])
|
||||
|
||||
courts = [606, 607, 608]
|
||||
sport_id = 217
|
||||
booking_date = pendulum.now().add(days=6).set(hour=18, minute=0, second=0)
|
||||
booking_filter = BookingFilter(court_ids=courts, sport_id=sport_id, date=booking_date)
|
||||
booking_filter = BookingFilter(sport_id=sport_id, date=booking_date)
|
||||
|
||||
booking_failure_response = json.dumps(
|
||||
{
|
||||
|
@ -45,10 +45,6 @@ booking_payload = (
|
|||
.build_booking_payload()
|
||||
)
|
||||
|
||||
session = ClientSession()
|
||||
gestion_sports_url = "https://toulousepadelclub.gestion-sports.com"
|
||||
gs_connector = GestionSportsConnector(session, gestion_sports_url)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def a_user() -> User:
|
||||
|
@ -60,6 +56,11 @@ def a_booking_filter() -> BookingFilter:
|
|||
return booking_filter
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def a_club() -> Club:
|
||||
return club
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def a_booking_success_response() -> str:
|
||||
return booking_success_response
|
||||
|
@ -73,8 +74,3 @@ def a_booking_failure_response() -> str:
|
|||
@pytest.fixture
|
||||
def a_booking_payload() -> str:
|
||||
return booking_payload
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def a_connector():
|
||||
return gs_connector
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue