refactored code to place the booking specific actions inside a gestion-sports element
This commit is contained in:
parent
26670bfe34
commit
59e2271c1b
2 changed files with 16 additions and 15 deletions
|
@ -33,8 +33,8 @@ class GestionSportsOperations:
|
|||
self.wait_until_booking_time(self.club, booking_filter)
|
||||
return await self.platform.book(booking_filter, self.club)
|
||||
|
||||
@staticmethod
|
||||
def wait_until_booking_time(club: Club, booking_filter: BookingFilter):
|
||||
|
||||
def wait_until_booking_time(club: Club, booking_filter: BookingFilter):
|
||||
"""
|
||||
Wait until the booking is open.
|
||||
The booking filter contains the date and time of the booking.
|
||||
|
|
|
@ -3,6 +3,7 @@ from unittest.mock import patch
|
|||
import pendulum
|
||||
import pytest
|
||||
from aioresponses import aioresponses
|
||||
from gestion_sports import gestion_sports_operations
|
||||
from gestion_sports.gestion_sports_operations import GestionSportsOperations
|
||||
from models import BookingFilter, Club, User
|
||||
|
||||
|
@ -76,6 +77,6 @@ def test_wait_until_booking_time(
|
|||
]
|
||||
mock_now.side_effect = seconds
|
||||
|
||||
GestionSportsOperations.wait_until_booking_time(a_club, a_booking_filter)
|
||||
gestion_sports_operations.wait_until_booking_time(a_club, a_booking_filter)
|
||||
|
||||
assert pendulum.now() == booking_datetime.add(microseconds=1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue