コード例 #1
0
ファイル: p_test.py プロジェクト: tonyishangu/pass
    def test_delete_credential(self):
        self.new_credential.save_details()
        test_credential = Credentials("Twitter","tonnieishangu","Mfh45hfk")
        test_credential.save_details()

        self.new_credential.delete_credentials()
        self.assertEqual(len(Credentials.credentials_list),1)
コード例 #2
0
 def test_save_many_accounts(self):
     '''
     test to check if we can save multiple credentials objects to our credentials list
     '''
     self.new_credential.save_details()
     test_credential = Credentials("Twitter", "byusadiamant", "byusa123")
     test_credential.save_details()
     self.assertEqual(len(Credentials.credentials_list), 2)
コード例 #3
0
 def test_save_many_accounts(self):
     '''
     test to check if we can save multiple credentials objects to our credentials list
     '''
     self.new_credential.save_details()
     test_credential = Credentials("Twitter", "mikeycharles", "Mfh45hfk")
     test_credential.save_details()
     self.assertEqual(len(Credentials.credentials_list), 2)
コード例 #4
0
 def test_save_many_account(self):
     '''
     test to check if we can save multiple credentials objects to our credentials list
     '''
     self.new_credentials.save_credentials()
     test_credential = Credentials("Facebook", "Brian Duke", "kulangombe")
     test_credential.save_credentials()
     self.assertEqual(len(Credentials.credentials_list), 2)
コード例 #5
0
ファイル: p_test.py プロジェクト: tonyishangu/pass
    def test_find_credentialr(self):

        self.new_credential.save_details()
        test_credential = Credentials("Twitter","tonnieishangu","Mfh45hfk") 
        test_credential.save_details()

        the_credential = Credentials.find_credential("Twitter")

        self.assertEqual(the_credential.account,test_credential.account)
コード例 #6
0
 def test_save_many_accounts(self):
     '''
     test to check if we can save multiple credentials objects to our credentials list
     '''
     self.new_credential.save_details()
     test_credential = Credentials("Instagram", "VallandyValary",
                                   "Mfh45hfk")
     test_credential.save_details()
     self.assertEqual(len(Credentials.credentials_list), 2)
コード例 #7
0
 def test_credential_exist(self):
     """
     test to check if we can return a true or false based on whether we find or can't find the credential.
     """
     self.new_credential.save_details()
     the_credential = Credentials("Instagram", "VallandyValary", "Mfh45hfk")
     the_credential.save_details()
     credential_is_found = Credentials.if_credential_exist("Instagram")
     self.assertTrue(credential_is_found)
コード例 #8
0
 def test_credential_exist(self):
     """
     test to check if we can return a true or false based on whether we find or can't find the credential.
     """
     self.new_credential.save_details()
     the_credential = Credentials("Twitter", "byusagisele", "byusa123")
     the_credential.save_details()
     credential_is_found = Credentials.if_credential_exist("Twitter")
     self.assertTrue(credential_is_found)
コード例 #9
0
    def test_delete_credential(self):
        """
        test method to test if we can remove an account credentials from our credentials_list
        """
        self.new_credential.save_details()
        test_credential = Credentials("Twitter", "mikeycharles", "Mfh45hfk")
        test_credential.save_details()

        self.new_credential.delete_credentials()
        self.assertEqual(len(Credentials.credentials_list), 1)
コード例 #10
0
    def test_credential_exist(self):
        """
        test to check if we can return a true or false based on whether we find or can't find the credential.
        """
        self.new_credentials.save_credentials()
        test_credential = Credentials("Twitter", "atemba", "Mfh45hfk")
        test_credential.save_credentials()

        found_credential = Credentials.if_credential_exist("Twitter")
        self.assertTrue(found_credential)
コード例 #11
0
    def test_credential_exist(self):
        """
        test to check if we can return a true or false based on whether we find or can't find the credential.
        """
        self.new_credentials.save_credentials()
        test_credential = Credentials("Facebook", "Brian Duke", "kulangombe")
        test_credential.save_credentials()

        found_credential = Credentials.if_credential_exist("Facebook")
        self.assertTrue(found_credential)
コード例 #12
0
    def test_delete_credential(self):
        """
        test method to test if we can remove an account credentials from our credentials_list
        """
        self.new_credential.save_details()
        test_credential = Credentials("Twitter", "byusadiamant", "byusa123")
        test_credential.save_details()

        self.new_credential.delete_credentials()
        self.assertEqual(len(Credentials.credentials_list), 1)
コード例 #13
0
    def test_delete_credential(self):
        """
        test method to test if we can remove an account credentials from our credentials_list
        """
        self.new_credentials.save_credentials()
        test_credential = Credentials("Facebook", "Brian Duke", "kulangombe")
        test_credential.save_credentials()

        self.new_credentials.delete_credentials()
        self.assertEqual(len(Credentials.credentials_list), 1)
コード例 #14
0
    def test_find_credentials(self):
        """
        test to check if we can find a credential entry by account name and display the details of the credential
        """

        self.new_credentials.save_credentials()
        test_credential = Credentials("Facebook", "Brian Duke", "kulangombe")
        test_credential.save_credentials()

        the_credential = Credentials.find_credential("Facebook")
        self.assertEqual(the_credential.account, test_credential.account)
コード例 #15
0
    def test_find_credentialr(self):
        """
        test to check if we can find a credential entry by account name and display the details of the credential
        """
        self.new_credential.save_details()
        test_credential = Credentials("Twitter", "byusadiamant", "byusa123")
        test_credential.save_details()

        the_credential = Credentials.find_credential("Twitter")

        self.assertEqual(the_credential.account, test_credential.account)
コード例 #16
0
    def test_delete_credential(self):
        """
        test method to test if we can remove an account credentials from our credentials_list
        """
        self.new_credential.save_details()
        test_credential = Credentials("Instagram", "VallandyValary",
                                      "Mfh45hfk")
        test_credential.save_details()

        self.new_credential.delete_credentials()
        self.assertEqual(len(Credentials.credentials_list), 1)
コード例 #17
0
    def test_find_credentialr(self):
        """
        test to check if we can find a credential entry by account name and display the details of the credential
        """
        self.new_credential.save_details()
        test_credential = Credentials("Twitter", "mikeycharles", "Mfh45hfk")
        test_credential.save_details()

        the_credential = Credentials.find_credential("Twitter")

        self.assertEqual(the_credential.account, test_credential.account)
コード例 #18
0
    def test_find_credentialr(self):
        """
        test to check if we can find a credential entry by account name and display the details of the credential
        """
        self.new_credential.save_details()
        test_credential = Credentials("Instagram", "VallandyValary",
                                      "Mfh45hfk")
        test_credential.save_details()

        the_credential = Credentials.find_credential("Instagram")

        self.assertEqual(the_credential.account, test_credential.account)
コード例 #19
0
class TestAccount(unittest.TestCase):
    def setUp(self):

        self.new_account = Credentials("facebook", "collins", "12345")

    def test_init(self):
        self.assertEqual(self.new_account.account, "facebook")
        self.assertEqual(self.new_account.username, "collins")
        self.assertEqual(self.new_account.password, "12345")

    def test_save_account(self):
        """
        test to check if it saves account
        """
        self.new_account.save_credentials()
        self.assertEqual(len(Credentials.credentials_list), 1)
コード例 #20
0
ファイル: run.py プロジェクト: Martha-Valary/password
def login_user(username, password):
    """
    function that checks whether a user exist and then login the user in.
    """

    check_user = Credentials.verify_user(username, password)
    return check_user
コード例 #21
0
    def test_display_all_saved_credentials(self):
        '''
        method that displays all the credentials that has been saved by the user
        '''

        self.assertEqual(Credentials.display_credentials(),
                         Credentials.credentials_list)
コード例 #22
0
ファイル: run.py プロジェクト: Martha-Valary/password
def generate_Password():
    '''
    generates a random password for the user.
    '''
    auto_password = Credentials.generatePassword()
    return auto_password
コード例 #23
0
ファイル: run.py プロジェクト: Martha-Valary/password
def check_credendtials(account):
    """
    Function that check if a Credentials exists with that account name and return true or false

    """
    return Credentials.if_credential_exist(account)
コード例 #24
0
ファイル: run.py プロジェクト: Martha-Valary/password
def find_credential(account):
    """
    Function that finds a Credentials by an account name and returns the Credentials that belong to that account
    """
    return Credentials.find_credential(account)
コード例 #25
0
ファイル: run.py プロジェクト: Martha-Valary/password
def display_accounts_details():
    """
    Function that returns all the saved credential.
    """
    return Credentials.display_credentials()
コード例 #26
0
ファイル: run.py プロジェクト: Martha-Valary/password
def create_new_credential(account, userName, password):
    """
    Function that creates new credentials for a given user account
    """
    new_credential = Credentials(account, userName, password)
    return new_credential
コード例 #27
0
ファイル: run.py プロジェクト: Martha-Valary/password
def copy_password(account):
    """
    A funct that copies the password using the pyperclip framework
    We import the framework then declare a function that copies the emails.
    """
    return Credentials.copy_password(account)
コード例 #28
0
ファイル: run.py プロジェクト: Albert-Byrone/Password-Locker
def copy_password(account):
    '''
    funcion that allows password to be copied and pasted using the pyperclip framework
    '''
    return Credentials.copy_password()
コード例 #29
0
class TestCredentials(unittest.TestCase):
    """
    A test class that defines test cases for credentials class

    """
    def setUp(self):
        '''
        Method that runs before each individual credentials test methods run.
        '''
        self.new_credentials = Credentials('Gmail', 'lekamcharity',
                                           'kulangombe')

    def test_ini_(self):
        """
        Test case to check if a new Credentials instance has been initialized correctly
        """

        self.assertEqual(self.new_credentials.account, 'Gmail')
        self.assertEqual(self.new_credentials.userName, 'lekamcharity')
        self.assertEqual(self.new_credentials.password, 'kulangombe')

    def test_save_credentials(self):
        """
        test case to test if the crential object is saved into the credentials list.

        """
        self.new_credentials.save_credentials()
        self.assertEqual(len(Credentials.credentials_list), 1)

    def tearDown(self):
        '''
        method that does clean up after each test case has run.
        '''
        Credentials.credentials_list = []

    def test_save_many_account(self):
        '''
        test to check if we can save multiple credentials objects to our credentials list
        '''
        self.new_credentials.save_credentials()
        test_credential = Credentials("Facebook", "Brian Duke", "kulangombe")
        test_credential.save_credentials()
        self.assertEqual(len(Credentials.credentials_list), 2)

    def test_delete_credential(self):
        """
        test method to test if we can remove an account credentials from our credentials_list
        """
        self.new_credentials.save_credentials()
        test_credential = Credentials("Facebook", "Brian Duke", "kulangombe")
        test_credential.save_credentials()

        self.new_credentials.delete_credentials()
        self.assertEqual(len(Credentials.credentials_list), 1)

    def test_find_credentials(self):
        """
        test to check if we can find a credential entry by account name and display the details of the credential
        """

        self.new_credentials.save_credentials()
        test_credential = Credentials("Facebook", "Brian Duke", "kulangombe")
        test_credential.save_credentials()

        the_credential = Credentials.find_credential("Facebook")
        self.assertEqual(the_credential.account, test_credential.account)

    def test_credential_exist(self):
        """
        test to check if we can return a true or false based on whether we find or can't find the credential.
        """
        self.new_credentials.save_credentials()
        test_credential = Credentials("Facebook", "Brian Duke", "kulangombe")
        test_credential.save_credentials()

        found_credential = Credentials.if_credential_exist("Facebook")
        self.assertTrue(found_credential)
コード例 #30
0
 def setUp(self):
     '''
     Method that runs before each individual credentials test methods run.
     '''
     self.new_credentials = Credentials('Gmail', 'lekamcharity',
                                        'kulangombe')