Exemplo n.º 1
0
 def test_save_multiple_credentials(self):
     '''
     Test the saving of multiple credentials
     '''
     self.new_credentials.save_credentials()
     test_credentials = Credentials("twitter", "Bot", "root")
     random_credentials = Credentials("Spotify", "user", "username")
     test_credentials.save_credentials()
     random_credentials.save_credentials()
     self.assertEqual(len(Credentials.credentials_list), 3)
Exemplo n.º 2
0
 def test_delete_credential(self):
     '''
     Test the deletion of one credential
     '''
     self.new_credentials.save_credentials()
     test_credentials = Credentials("twitter", "Bot", "root")
     random_credentials = Credentials("Spotify", "user", "username")
     test_credentials.save_credentials()
     random_credentials.save_credentials()
     random_credentials.delete_credential()
     self.assertEqual(len(Credentials.credentials_list),2)
Exemplo n.º 3
0
 def test_credential_exist(self):
     '''
     Test that a credential exists
     '''
     self.new_credentials.save_credentials()
     test_credentials = Credentials("twitter", "Bot", "root")
     random_credentials = Credentials("Spotify", "user", "username")
     test_credentials.save_credentials()
     random_credentials.save_credentials()
     
     account_exists = Credentials.account_exists("Spotify")
     self.assertTrue(account_exists)
Exemplo n.º 4
0
 def test_find_by_account_name(self):
     '''
     Test finding an account by it's name
     '''
     self.new_credentials.save_credentials()
     test_credentials = Credentials("twitter", "Bot", "root")
     random_credentials = Credentials("Spotify", "user", "username")
     test_credentials.save_credentials()
     random_credentials.save_credentials()
     
     found_account = Credentials.find_by_account_name("Spotify")
     self.assertEqual(random_credentials.account_name, found_account.account_name)
Exemplo n.º 5
0
def get_credentials():
    result = Credentials()

    file = open("credentials.txt", "r")

    result.method = file.readline().strip()
    result.domain = file.readline().strip()
    result.endpoint_badges = file.readline().strip()
    result.endpoint_profile = file.readline().strip()
    result.key_recipient = file.readline().strip()
    result.key_badge = file.readline().strip()
    result.key_message = file.readline().strip()
    result.key_token = file.readline().strip()
    result.prefix_cookie = file.readline().strip()

    file.close()

    return result
Exemplo n.º 6
0
def create_credentials(account_name, user_name, password):
    '''
    Function to create credentials
    '''
    new_credential = Credentials(account_name, user_name, password)
    return new_credential
Exemplo n.º 7
0
def create_credential(user_namez, site_name, passwordz):
    new_credential = Credentials(user_namez, site_name, passwordz)
    return new_credential
Exemplo n.º 8
0
 def setUp(self):
     '''
     SetUp method that is performed everytime a test case is run
     '''
     self.new_credentials = Credentials("instagram","usertest","userpass")