core: better annimations

This commit is contained in:
starnakin 2023-11-06 15:53:59 +01:00
parent 617b67df24
commit 22ff3d58d3
3 changed files with 6 additions and 6 deletions

View File

@ -5,7 +5,7 @@ from tests.utils import test
def test_accounts_register(client, username, password): def test_accounts_register(client, username, password):
print ("REGISTER") print ("REGISTER")
test(client.accounts.create(username, password), b'ok: user added', 'normal', None) test(client.accounts.create, (username, password), b'ok: user added', 'normal', None)
print() print()
@ -13,7 +13,7 @@ def test_accounts_login(client, username, password):
print ("LOGIN") print ("LOGIN")
test(client.login(username, password), b'ok: account valid', "normal", None) test(client.login, (username, password), b'ok: account valid', "normal", None)
print() print()
@ -21,7 +21,7 @@ def test_accounts_delete(client):
print ("DELETE") print ("DELETE")
test(client.accounts.delete(), b'ok: account has been deleted', 'normal') test(client.accounts.delete, (), b'ok: account has been deleted', 'normal')
print() print()

View File

@ -10,7 +10,7 @@ def test_profiles_get(client):
print ("GET") print ("GET")
test(client.profiles.get(1), Profile(username="997e13f5-474d-4fea-b55a-ad8a27b9534b", title=""), "normal") test(client.profiles.get, (1, ), Profile(username="997e13f5-474d-4fea-b55a-ad8a27b9534b", title=""), "normal")
print() print()

View File

@ -1,6 +1,6 @@
def test(value, expected_value, title, description = None): def test(func: callable, params, expected_value, title: str, description = None):
print(title, end=" ") print(title, end=" ")
if (value == expected_value): if (func(*params) == expected_value):
print("[OK]") print("[OK]")
return return
print ("[ERROR]") print ("[ERROR]")