diff --git a/src/tests.py b/src/tests.py index 5cbc4f2..675578a 100644 --- a/src/tests.py +++ b/src/tests.py @@ -1,13 +1,16 @@ import Client +import Profile from urls import * from uuid import uuid4 +import os def test(value, expected_value, title, description = None): + print(title, end=" ") if (value == expected_value): - print(title, "[OK]") + print("[OK]") return - print (title, "[ERROR]") + print ("[ERROR]") print ("expected", expected_value, ", got", value) if not description is None: print (description) @@ -36,7 +39,12 @@ def test_accounts_delete(client): print() def test_profile_get(client): - pass + + print ("GET") + + test(client.profiles.get(1), Profile.Profile(username="997e13f5-474d-4fea-b55a-ad8a27b9534b", title=""), "normal") + + print() def tests(): @@ -45,11 +53,12 @@ def tests(): client = Client.Client("http://0.0.0.0:8000/") - + print("ACCOUNTS".center(os.get_terminal_size()[0], '-')) test_accounts_register(client, username, password) test_accounts_login(client, username, password) test_accounts_delete(client) - + + print("ACCOUNTS".center(os.get_terminal_size()[0], '-')) test_profile_get(client) if __name__ == "__main__":