示例#1
0
    def test_save_account(self):
        '''
        Test to check if the new account inputted is saved into the accounts list
        '''
        self.new_account.save_account()
		Instagram = Account('Mariam','Instagram','mariri','6969')
		Instagram.save_account()
示例#2
0
class TestAccount(unittest.TestCase):
    def setUp(self):
        self.new_account = Account("Instagram", "Bonte", "kind")

    def test_init(self):
        self.assertEqual(self.new_account.account_name, "Instagram")
        self.assertEqual(self.new_account.account_userName, "Bonte")
        self.assertEqual(self.new_account.account_password, "kind")

    def test_save_account(self):
        self.new_account.save_account()
        self.assertEqual(len(Account.account_list), 2)

    def tearDown(self):
        Account.account_list = []

    def test_display_account_credentials(self):
        self.assertEqual(Account.display_accounts(), Account.account_list)

    def test_delete_account(self):
        self.new_account.save_account()
        test_account = Account("Twitter", "Bonte", "kinder")
        test_account.save_account()
        test_account.delete_account()
        self.assertEqual(len(Account.account_list), 1)

    def test_find_account_by_name(self):
        self.new_account.save_account()
        test_account = Account("Medium", "Emma", "kindern")
        test_account.save_account()
        found_account = Account.find_by_accountName("Medium")
        self.assertEqual(found_account.account_name, "Medium")
示例#3
0
class TestAccount(unittest.TestCase):
    def setUp(self):
        self.new_account = Account("Instagram", "Uwimana", "ange2020")
    def test_init(self):
        self.assertEqual(self.new_account.account_name,"Instagram")
        self.assertEqual(self.new_account.account_username,"Uwimana")
        self.assertEqual(self.new_account.account_password,"ange2020")
    def test_save_account(self):
        self.new_account.save_account()
        self.assertEqual(len(Account.account_list),1)

    def tearDown(self):
        Account.account_list = []
    def test_display_account_credentials(self):
        self.assertEqual(Account.display_accounts(),Account.account_list)

    def test_delete_account(self):
        self.new_account.save_account()
        test_account = Account("Twitter", "angeange", "angeange2020")
        test_account.save_account()
        test_account.delete_account()
        self.assertEqual(len(Account.account_list),1)

    def test_find_account_by_name(self):
        self.new_account.save_account()
        test_account = Account("Facebook", "uwimana", "1234567")
        test_account.save_account()
        found_account = Account.find_by_accountName("Facebook")
        self.assertEqual(found_account.account_name,"Facebook")
示例#4
0
 def test_find_account_by_name(self):
     self.new_account.save_account()
     test_account = Account("Medium", "Emma", "kindern")
     test_account.save_account()
     found_account = Account.find_by_accountName("Medium")
     self.assertEqual(found_account.account_name, "Medium")
示例#5
0
 def test_delete_account(self):
     self.new_account.save_account()
     test_account = Account("Twitter", "Bonte", "kinder")
     test_account.save_account()
     test_account.delete_account()
     self.assertEqual(len(Account.account_list), 1)
示例#6
0
def save_account(Account):
    '''
	Function to save a new account
	'''
    Account.save_account()
示例#7
0
 def test_delete_account(self):
     self.new_account.save_account()
     test_account = Account("Twitter", "angeange", "angeange2020")
     test_account.save_account()
     test_account.delete_account()
     self.assertEqual(len(Account.account_list),1)
示例#8
0
 def test_find_account_by_name(self):
     self.new_account.save_account()
     test_account = Account("Facebook", "uwimana", "1234567")
     test_account.save_account()
     found_account = Account.find_by_accountName("Facebook")
     self.assertEqual(found_account.account_name,"Facebook")
示例#9
0
 def test_find_account_by_name(self):
     self.new_account.save_account()
     test_account = Account("Medium", "Tesire", "sweetest")
     test_account.save_account()
     found_account = Account.find_by_accountName("Medium")
     self.assertEqual(found_account.account_name,"Medium")