-
Notifications
You must be signed in to change notification settings - Fork 0
/
accounts_test.py
37 lines (29 loc) · 1.18 KB
/
accounts_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
import unittest
import pyperclip
from users import User
from accounts import Account
class AccountsTest(unittest.TestCase):
def setUp(self):
self.new_account = Account(
'Instagram', 'https://www.instagram.com/', 'wambsviki@gmail.com', '12345')
def test_init(self):
self.assertEqual(self.new_account.account_name, 'Instagram')
self.assertEqual(self.new_account.account_url,
'https://www.instagram.com/')
self.assertEqual(self.new_account.email, 'wambsviki@gmail.com')
self.assertEqual(self.new_account.password, '12345')
def test_save_account(self):
account = self.new_account.save_account()
self.assertEqual(
account['name'], 'Instagram')
self.assertEqual(
account['link_url'], 'https://www.instagram.com/')
self.assertEqual(
account['email'], 'wambsviki@gmail.com')
self.assertEqual(account['password'], '12345')
def test_copy_email(self):
acc = self.new_account.save_account()
email = self.new_account.copy_email(acc, 'email')
print(pyperclip.paste(email))
if __name__ == '__main__':
unittest.main()