Added a lot of unit tests
This commit is contained in:
parent
0938fb98b7
commit
16d4a0724c
32 changed files with 4268 additions and 497 deletions
|
@ -1,51 +0,0 @@
|
|||
import os
|
||||
from unittest.mock import patch
|
||||
|
||||
import config
|
||||
from pendulum import DateTime, Timezone
|
||||
|
||||
|
||||
@patch.dict(
|
||||
os.environ,
|
||||
{
|
||||
"SPORT_NAME": "Padel",
|
||||
"DATE_TIME": "2024-02-03T22:38:45Z",
|
||||
},
|
||||
clear=True,
|
||||
)
|
||||
def test_get_booking_filter():
|
||||
booking_filter = config.get_booking_filter()
|
||||
assert booking_filter.sport_id == "padel"
|
||||
assert booking_filter.date == DateTime(
|
||||
year=2024,
|
||||
month=2,
|
||||
day=3,
|
||||
hour=23,
|
||||
minute=38,
|
||||
second=45,
|
||||
tzinfo=Timezone("Europe/Paris"),
|
||||
)
|
||||
|
||||
|
||||
@patch.dict(
|
||||
os.environ,
|
||||
{
|
||||
"LOGIN": "login@user.tld",
|
||||
"PASSWORD": "gloups",
|
||||
},
|
||||
clear=True,
|
||||
)
|
||||
def test_get_available_user():
|
||||
user = config.get_user()
|
||||
assert user.login == "login@user.tld"
|
||||
assert user.password == "gloups"
|
||||
|
||||
|
||||
def test_read_clubs():
|
||||
clubs = config.get_clubs()
|
||||
assert len(clubs) == 2
|
||||
|
||||
|
||||
def test_get_users():
|
||||
users = config.get_users("tpc")
|
||||
assert len(users) == 2
|
Loading…
Add table
Add a link
Reference in a new issue