35 lines
801 B
Python
35 lines
801 B
Python
|
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)
|