Beispiel #1
0
 def test_get_credentials(self):
     session_credentials = session.get_session_credentials()
     if "username" in session_credentials:
         del session._session["credentials"]["username"]
     if "api_key" in session_credentials:
         del session._session["credentials"]["api_key"]
     creds = py.get_credentials()
     file_creds = tls.get_credentials_file()
     self.assertEqual(creds, file_creds)
Beispiel #2
0
 def test_get_credentials(self):
     session_credentials = session.get_session_credentials()
     if 'username' in session_credentials:
         del session._session['credentials']['username']
     if 'api_key' in session_credentials:
         del session._session['credentials']['api_key']
     creds = py.get_credentials()
     file_creds = tls.get_credentials_file()
     self.assertEqual(creds, file_creds)
Beispiel #3
0
 def test_get_credentials(self):
     session_credentials = session.get_session_credentials()
     if 'username' in session_credentials:
         del session._session['credentials']['username']
     if 'api_key' in session_credentials:
         del session._session['credentials']['api_key']
     creds = py.get_credentials()
     file_creds = tls.get_credentials_file()
     self.assertEqual(creds, file_creds)
Beispiel #4
0
    def test_get_credentials_file(self):

        # Check get_credentials returns all the keys

        original_creds = tools.get_credentials_file()
        expected = [
            'username', 'stream_ids', 'api_key', 'proxy_username',
            'proxy_password'
        ]
        self.assertTrue(all(x in original_creds for x in expected))
Beispiel #5
0
def get_credentials():
    """Returns the credentials that will be sent to plotly."""
    credentials = tools.get_credentials_file()
    session_credentials = session.get_session_credentials()
    for credentials_key in credentials:

        # checking for not false, but truthy value here is the desired behavior
        session_value = session_credentials.get(credentials_key)
        if session_value is False or session_value:
            credentials[credentials_key] = session_value
    return credentials
Beispiel #6
0
    def test_get_credentials_file(self):

        # Check get_credentials returns all the keys

        original_creds = tools.get_credentials_file()
        expected = [
            "username",
            "stream_ids",
            "api_key",
            "proxy_username",
            "proxy_password",
        ]
        self.assertTrue(all(x in original_creds for x in expected))