コード例 #1
0
 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)
コード例 #2
0
 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)
コード例 #3
0
 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)
コード例 #4
0
 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)
コード例 #5
0
 def setUp(self):
     '''
     set up method to run before each test cases
     '''
     self.new_account = passwords("Account", "Testname", "TestPass")
コード例 #6
0
def create_account(account_name, user_name, password):
    '''
    function to create new account
    '''
    new_account = passwords(account_name, user_name, password)
    return new_account