From 22ff3d58d3208ab8493a63425b401f2ed6c0ca40 Mon Sep 17 00:00:00 2001 From: starnakin Date: Mon, 6 Nov 2023 15:53:59 +0100 Subject: [PATCH] core: better annimations --- tests/accounts.py | 6 +++--- tests/profiles.py | 2 +- tests/utils.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/accounts.py b/tests/accounts.py index 6c0941a..335a193 100644 --- a/tests/accounts.py +++ b/tests/accounts.py @@ -5,7 +5,7 @@ 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) + test(client.accounts.create, (username, password), b'ok: user added', 'normal', None) print() @@ -13,7 +13,7 @@ def test_accounts_login(client, username, password): 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() @@ -21,7 +21,7 @@ def test_accounts_delete(client): 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() diff --git a/tests/profiles.py b/tests/profiles.py index d0e2290..7cddfa7 100644 --- a/tests/profiles.py +++ b/tests/profiles.py @@ -10,7 +10,7 @@ def test_profiles_get(client): 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() diff --git a/tests/utils.py b/tests/utils.py index 5a4fd97..11914b5 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -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=" ") - if (value == expected_value): + if (func(*params) == expected_value): print("[OK]") return print ("[ERROR]")