add: test to profiles
This commit is contained in:
parent
1900a6f390
commit
3c96defea3
19
src/tests.py
19
src/tests.py
@ -1,13 +1,16 @@
|
|||||||
import Client
|
import Client
|
||||||
|
import Profile
|
||||||
from urls import *
|
from urls import *
|
||||||
|
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
|
import os
|
||||||
|
|
||||||
def test(value, expected_value, title, description = None):
|
def test(value, expected_value, title, description = None):
|
||||||
|
print(title, end=" ")
|
||||||
if (value == expected_value):
|
if (value == expected_value):
|
||||||
print(title, "[OK]")
|
print("[OK]")
|
||||||
return
|
return
|
||||||
print (title, "[ERROR]")
|
print ("[ERROR]")
|
||||||
print ("expected", expected_value, ", got", value)
|
print ("expected", expected_value, ", got", value)
|
||||||
if not description is None:
|
if not description is None:
|
||||||
print (description)
|
print (description)
|
||||||
@ -36,7 +39,12 @@ def test_accounts_delete(client):
|
|||||||
print()
|
print()
|
||||||
|
|
||||||
def test_profile_get(client):
|
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():
|
def tests():
|
||||||
|
|
||||||
@ -45,11 +53,12 @@ def tests():
|
|||||||
|
|
||||||
client = Client.Client("http://0.0.0.0:8000/")
|
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_register(client, username, password)
|
||||||
test_accounts_login(client, username, password)
|
test_accounts_login(client, username, password)
|
||||||
test_accounts_delete(client)
|
test_accounts_delete(client)
|
||||||
|
|
||||||
|
print("ACCOUNTS".center(os.get_terminal_size()[0], '-'))
|
||||||
test_profile_get(client)
|
test_profile_get(client)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
Loading…
Reference in New Issue
Block a user