Exemple #1
0
def create_credential(un_name,username,site,password):

    '''
    method to create new credentials
    '''
    new_credential = Credentials(un_name,username,site,password)
    return new_credential
    def test_save_multiple_credentials(self):

        '''
        test case checks if it is possible to save multiple credentials in the referenzen list
        '''

        self.new_credential.save_credentials()
        test_credential = Credentials("Mary", "Peaches", "twitter", "peaches123")
        test_credential.save_credentials()
        self.assertEqual(len(Credentials.referenzen_list),2)
    def test_delete_credential(self):

        '''
        test case to determine if it is possible to remove a credential from the credential list
        '''

        self.new_credential.save_credentials()
        test_credential = Credentials("Jane", "Eyre", "facebook", "char257")
        test_credential.save_credentials()

        self.new_credential.delete_credential()
        self.assertEqual(len(Credentials.referenzen_list),1)
    def test_find_by_site(self):

        '''
        test to find out if user can find credentials using site name
        '''

        self.new_credential.save_credentials()
        test_credential = Credentials("Jane", "Eyre", "facebook", "char257")
        test_credential.save_credentials()

        found_credential = Credentials.find_by_site("facebook")
        
        self.assertEqual(found_credential.password, test_credential.password)
    def setUp(self):

        '''
        SetUp() method defines the instructions that will be excuted before each test method
        '''
        self.new_credential = Credentials("Mary", "Njihia", "reddit", "hgnkf2542")