-
Notifications
You must be signed in to change notification settings - Fork 0
/
user_test.py
40 lines (24 loc) · 861 Bytes
/
user_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from user import Users
from details import Details
import random
import unittest
class TestUser(unittest.TestCase):
def setUp(self):
self.aa = Users("Naf", "12345678")
def test_init(self):
self.assertEqual(self.aa.username, "Naf")
self.assertEqual(self.aa.password, "12345678")
def test_save_user(self):c
self.aa.login()
self.assertEqual(len(Users.aa), 1)
def tearDown(self):
Users.aa = []
@classmethod
def display_details(cls, username):
users_details_list = []
for detail in details.bb:
if detail.username == username:
users_details_list.append(detail)
return users_details_list
if __name__ == "__main__":
unittest.main()