Exemplo n.º 1
0
def main():
    print("Safest password locker\n")
    register = welcome()
    print(register)
    print("you can now proceed\n")

    if register:
        login = True
        while login:
            options = int(
                input(
                    "1)create account\n2)view account\n3)delete account\n4)Exit\n"
                ))
            if options == 1:

                account = input("enter account name")

                email = input("enter email")
                num = int(input("length password"))
                password = actual(num)

                Credential(account, password, email)
            elif options == 2:
                Credential.display_account()
            elif options == 3:
                acc = input("which account to delete ? ")
                Credential.delete(acc)
            elif options == 4:
                login = False
Exemplo n.º 2
0
    def test_save_credentials(self):
        '''
		Test to check if the new credential info is saved into the credentials list
		'''
        self.new_credential.save_credentials()
        account = Credential("shema", "Instagram", "shema")
        account.save_credentials()
        self.assertEqual(len(Credential.credentials_list), 2)
Exemplo n.º 3
0
 def test_saveMoreAccount(self):
     """
  this function helps us to save more than one account and test them
 """
     self.newAccount.saveAccount()
     testAccount = Credential("facebook", "hernandez", "moringa02")
     testAccount.saveAccount()
     self.assertEqual(len(Credential.accountList), 2)
Exemplo n.º 4
0
 def findByUsername(self):
     """
   function to test account by username
 """
     self.newAccount.saveAccount()
     testAccount = Credential("Pinterest", "Dennis Hg" "momo05")
     testAccount.saveAccount()
     findbyUsername = Credential.findByuser()
     self.assertEqual(findbyUsername.l_username.testAccount.l_username)
Exemplo n.º 5
0
 def testCheckExistingAccount(self):
     """
   Function to test and check if account exist or not
 """
     self.newAccount.saveAccount()
     testAccount = Credential("Ayoba", "deno", "dano")
     testAccount.saveAccount()
     existingAccount = Credential.existingAccount("Ayoba")
     self.assertTrue(existingAccount)
Exemplo n.º 6
0
 def deleteAccountTest(self):
     """
   this function delete account check if test has passed from account list
 """
     self.newAccount.saveAccount()
     testAccount = Credential("Twitter", "dennishg250", "moriinga03")
     testAccount.saveAccount()
     self.newAccount.deleteAccount()
     self.assertEqual(len(Credential.accountList), 1)
Exemplo n.º 7
0
    def setUp(self):
        '''
		Function to create an account's credentials before each test
		'''
        self.new_credential = Credential("Nancy", "Twitter", "nancy")
Exemplo n.º 8
0
def createAccount(accountName, l_username, l_password):
    """
    function to create new account
  """
    newAccount = Credential(accountName, l_username, l_password)
    return newAccount
Exemplo n.º 9
0
 def setUp(self):
     """
   set up function to run before each test
 """
     self.newAccount = Credential("Instagram", "dennis_250", "moringa01")
Exemplo n.º 10
0
def rema_konti(konti, username, password):
    '''
    Function to create a new credential
    '''
    account = Credential(konti, username, password)
    return account