ft_transcendence/tests/accounts.py

35 lines
807 B
Python
Raw Normal View History

2023-11-06 08:36:28 -05:00
from uuid import uuid4
from tests.utils import test
def test_accounts_register(client, username, password):
print ("REGISTER")
2023-11-06 09:53:59 -05:00
test(client.accounts.create, (username, password), b'ok: user added', 'normal', None)
2023-11-06 08:36:28 -05:00
print()
def test_accounts_login(client, username, password):
print ("LOGIN")
2023-11-06 09:53:59 -05:00
test(client.login, (username, password), b'ok: account valid', "normal", None)
2023-11-06 08:36:28 -05:00
print()
def test_accounts_delete(client):
print ("DELETE")
2023-11-06 09:53:59 -05:00
test(client.accounts.delete, (), b'ok: account has been deleted', 'normal')
2023-11-06 08:36:28 -05:00
print()
def test_accounts(client):
username = uuid4()
password = uuid4()
test_accounts_register(client, username, password)
test_accounts_login(client, username, password)
test_accounts_delete(client)