Esempio n. 1
0
 def test_find_by_account_name(self):
     '''
     test to check if we can find a credential by account_name and display information
     '''
     self.new_credential.save_credentials()
     facebook = Credential('Ariana','Facebook','google.com','twpd254')
     facebook.save_credentials()
     credential_exists= Credential.find_by_account_name('Facebook')
     self.assertEqual(credential_exists,facebook)
Esempio n. 2
0
 def test_copy_credential(self):
     '''
     Test to check if the method copies a users credential to the clipboard
     '''
     self.new_credential.save_credentials()
     facebook = Credential('Ariana','Facebook','google.com','twpd254')
     facebook.save_credentials()
     find_credential = None
     for credential in Credential.user_credentials_list:
         find_credential = Credential.find_by_account_name(credential.account_name)
         return pyperclip.copy(find_credential.password)
     Credential.copy_credential(self.new_credential.account_name)
     self.assertEqual('twpd254',pyperclip.paste())
     print(pyperclip.paste())
Esempio n. 3
0
def find_credential(account_name):
    '''
    Function that finds a credential by account_name and returns the credential
    '''
    return Credential.find_by_account_name(account_name)