22 lines
611 B
Python
22 lines
611 B
Python
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
|