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)
 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())
Esempio n. 3
0
def find_my_website(website_name):
    '''
    Function that searches for a website name.
    '''
    return Details.find_my_website_name(website_name)