ft_transcendence/tests/accounts.py

35 lines
801 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")
test(client.accounts.create(username, password), b'ok: user added', 'normal', None)
print()
def test_accounts_login(client, username, password):
print ("LOGIN")
test(client.login(username, password), b'ok: account valid', "normal", None)
print()
def test_accounts_delete(client):
print ("DELETE")
test(client.accounts.delete(), b'ok: account has been deleted', 'normal')
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)