def find_social_account(social_account): ''' finding a social account and return its details :param social_account: :return: ''' return SocialAccounts.find_account_by_name(social_account)
def test_find_account_by_name(self): ''' this is to enable users search their credentials by social account name e.g twitter and display the logins ''' self.new_social_account.save_social_account() test_social_account = SocialAccounts("video","phoebe", "passvideo", "4") #new account to save test_social_account.save_social_account() found_social_account= SocialAccounts.find_account_by_name('video') self.assertEqual(found_social_account.social_account_username, test_social_account.social_account_username)
def test_find_account_by_name(self): ''' this is to enable users search their credentials by social account name e.g twitter and display the logins ''' self.new_social_account.save_social_account() test_social_account = SocialAccounts("musical.ly", "cherucole", "passmusic", "9") #new account to save test_social_account.save_social_account() found_social_account = SocialAccounts.find_account_by_name( 'musical.ly') self.assertEqual(found_social_account.social_account_username, test_social_account.social_account_username)
# def test_copy_username(self): # ''' # Test to confirm we are copying the username from a found account # ''' # self.new_social_account.save_social_account() # SocialAccounts.copy_username("facebook") # # self.assertEqual(self.new_social_account.social_account_username,pyperclip.paste()) if __name__=='__main__': unittest.main() self.new_social_account.save_social_account() test_social_account = SocialAccounts("video","phoebe", "passvideo", "4") #new account to save test_social_account.save_social_account() found_social_account= SocialAccounts.find_account_by_name('video') self.assertEqual(found_social_account.social_account_username, test_social_account.social_account_username) def test_social_account_exists(self): ''' we want to return a boolean if we cannot find a contact ''' self.new_social_account.save_social_account() test_social_account = SocialAccounts("video","phoebe", "passvideo", "4") #new account to save test_social_account.save_social_account() account_exists= SocialAccounts.social_account_exists("video") self.assertTrue(account_exists) def test_display_all_social_accounts(self): '''