def test_save_multiple_accounts(self): # test 3 ''' test to check if one can save multiple accounts ''' self.new_account.save_account() test_account = passwords("Account", "Testname", "TestPass") test_account.save_account() self.assertEqual(len(passwords.password_list), 2)
def test_account_exists(self): # test 6 ''' test to check if account really exists ''' self.new_account.save_account() test_account = passwords("Account", "Testname", "TestPass") test_account.save_account() account_exists = passwords.account_exists("Account") self.assertTrue(account_exists)
def test_find_account_by_account_name(self): #fifth test ''' test to search for account details ''' self.new_account.save_account() test_account = passwords("Account", "Testname", "TestPass") test_account.save_account() found_account = passwords.find_by_account("Account") self.assertEqual(found_account.user_name, test_account.user_name)
def test_delete_passwords(self): # test 4 ''' test to check if one can delete account passwords ''' self.new_account.save_account() test_account = passwords("Account", "Testname", "TestPass") test_account.save_account() self.new_account.delete_account() # delete credential self.assertEqual(len(passwords.password_list), 1)
def setUp(self): ''' set up method to run before each test cases ''' self.new_account = passwords("Account", "Testname", "TestPass")
def create_account(account_name, user_name, password): ''' function to create new account ''' new_account = passwords(account_name, user_name, password) return new_account