Main page of booking platform can be reached
This commit is contained in:
parent
190d4d2a4b
commit
95e313d922
7 changed files with 571 additions and 3 deletions
22
tests/test_booking.py
Normal file
22
tests/test_booking.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
import pytest
|
||||
|
||||
from resa_padel import booking
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_connection_to_booking_platform(aioresponses):
|
||||
# mock connection to the booking platform
|
||||
booking_platform_url = "https://some.url"
|
||||
body = """<head>
|
||||
<title>Booking Platform</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>BODY</p>
|
||||
</body>"""
|
||||
aioresponses.get(booking_platform_url, status=200, body=body)
|
||||
|
||||
booking_response = await booking.connect(booking_platform_url)
|
||||
|
||||
assert booking_response.status == 200
|
||||
assert booking_response.method == "get"
|
||||
assert await booking_response.text() == body
|
19
tests/test_gestion_sports_connector.py
Normal file
19
tests/test_gestion_sports_connector.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
import pytest
|
||||
from yarl import URL
|
||||
|
||||
from resa_padel.gestion_sports_connector import GestionSportsConnector
|
||||
|
||||
gestion_sports_url = "https://toulousepadelclub.gestion-sports.com"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_should_connect_to_gestion_sports_website():
|
||||
gs_connector = GestionSportsConnector(gestion_sports_url)
|
||||
|
||||
response = await gs_connector.connect()
|
||||
|
||||
assert response.status == 200
|
||||
assert response.method == "GET"
|
||||
assert response.content_type == "text/html"
|
||||
assert response.url == URL(gestion_sports_url + "/connexion.php")
|
||||
assert response.charset == "UTF-8"
|
Loading…
Add table
Add a link
Reference in a new issue