예제 #1
0
    def test_display_details(self):
        '''

        '''
        self.new_details.save_details()
        facebook = Details('Ben','Facebook','Benny','test01')
        facebook.save_details()
        twitter = Details('Ben','Twitter','Benny','test01')
        twitter.save_details()
 def test_display_details(self):
     '''
     Test case to test if objects show.
     '''
     self.new_detail.save_detail()
     instagram = Details("Deyalasoul", "Instagram", "Deyala",
                         "Roseflower01")
     instagram.save_detail()
     twitter = Details('Bill', 'Twitter', 'billy', 'billyboss')
     twitter.save_detail()
     self.assertEqual(len(Details.display_detail(instagram.user_name)), 1)
예제 #3
0
    def test_save_details(self):
        '''

        '''
        self.new_details.save_details()
        facebook = Details('Joe','Facebook','Benny','test01')
        facebook.save_details()
        self.assertEqual(len(Details.details_list),2)
 def test_save_details(self):
     '''
     Test case to check if we can save details to the details list.
     '''
     self.new_detail.save_detail()
     instagram = Details("Deyalasoul", "Instagram", "Deyala",
                         "Roseflower01")
     instagram.save_detail()
     self.assertEqual(len(Details.details_list), 2)
 def test_find_my_website_name(self):
     '''
     Test case to test if we can search credential by site_name and return the correct credential.
     '''
     self.new_detail.save_detail()
     twitter = Details('Bill', 'Twitter', 'billy', 'billyboss')
     twitter.save_detail()
     detail_exist = Details.find_my_website_name('Twitter')
     self.assertEqual(detail_exist, twitter)
예제 #6
0
    def test_find_by_site_name(self):
        '''

        '''
        self.new_details.save_details()
        facebook = Details('Ben','Facebook','Benny','test01')
        facebook.save_details()
        details_exists = Details.find_by_site_name('Facebook')
        self.assertEqual(details_exists,facebook)
    def test_credential_exists(self):
        '''
        Test case to confirm if a detail exist in the detail_list.
        '''
        self.new_detail.save_detail()
        test_detail = Details('Bill', 'Twitter', 'billy', 'billyboss')
        test_detail.save_detail()

        detail_exists = Details.detail_exist("Twitter")
        self.assertTrue(detail_exists)
    def test_delete_detail(self):
        '''
        Test to see if we can delete a saved detail
        '''
        self.new_detail.save_detail()
        new_detail = Details('Bill', 'Twitter', 'billy', 'billyboss')
        new_detail.save_detail()

        self.new_detail.del_detail()
        self.assertEqual(len(Details.details_list), 1)
 def test_copy_details(self):
     '''
     Test casse to test if the copy detail function copies the correct detail of the user.
     '''
     self.new_detail.save_detail()
     facebook = Details('Dolphine', 'Facebook', 'dalphine', 'atieno1997')
     facebook.save_detail()
     find_detail = None
     for detail in Details.users_details_list:
         find_detail = Details.find_my_website_name(detail.website_name)
         pyperclip.copy(find_detail.password)
     Details.copy_detail(self.new_detail.website_name)
     self.assertEqual('atieno1997', pyperclip.paste())
예제 #10
0
    def test_copy_details(self):
        '''

        '''
        self.new_details.save_details()
        facebook = Details('Ben','Facebook','Benny','test01')
        facebook.save_details()
        find_details = None
        for details in Details.user_details_list:
            find_details=Details.find_by_site_name(details.site)
            return pyperclip.copy(find_details.password)
        Details.copy_details(self.new_details.site)
        self.assertEqual('test01',pyperclip.paste())
        print(pyperclip.paste())
예제 #11
0
def create_detail(user_name, website_name, account_name, password):
    '''
    Function creates new user details.
    '''
    new_detail = Details(user_name, website_name, account_name, password)
    return new_detail
 def setUp(self):
     '''
     set up method to run before each test cases.
     '''
     self.new_detail = Details("Dolphine", "Facebook", "dalphine",
                               "atieno1997")
예제 #13
0
    def setUp(self):
        '''

        '''
        self.new_details = Details('Ben','Instagram','Benny','test01')
예제 #14
0
def create_detail(username, site, account, password):
    '''
    create new user details
    '''
    new_details = Details(username, site, account, password)
    return new_details