def test_valid_credentials(self): creds = httplib2_utils.get_signed_jwt_assertion_credentials( 'valid_creds.json', service_accounts_creds_root=DATA_DIR) self.assertIsInstance( creds, oauth2client.client.SignedJwtAssertionCredentials) # A default scope must be provided, we don't care which one self.assertTrue(creds.scope)
def test_valid_credentials_with_scope_as_list(self): creds = httplib2_utils.get_signed_jwt_assertion_credentials( 'valid_creds.json', scope=['gist'], service_accounts_creds_root=DATA_DIR) self.assertIsInstance(creds, oauth2client.client.SignedJwtAssertionCredentials) self.assertIn('gist', creds.scope)
def test_valid_credentials(self): creds = httplib2_utils.get_signed_jwt_assertion_credentials( 'valid_creds.json', service_accounts_creds_root=DATA_DIR) self.assertIsInstance(creds, oauth2client.client.SignedJwtAssertionCredentials) # A default scope must be provided, we don't care which one self.assertTrue(creds.scope)
def test_valid_credentials_with_scope_as_list(self): creds = httplib2_utils.get_signed_jwt_assertion_credentials( 'valid_creds.json', scope=['gist'], service_accounts_creds_root=DATA_DIR) self.assertIsInstance( creds, oauth2client.client.SignedJwtAssertionCredentials) self.assertIn('gist', creds.scope)
def test_malformed_credentials(self): with self.assertRaises(httplib2_utils.AuthError): httplib2_utils.get_signed_jwt_assertion_credentials( 'creds_malformed.json', service_accounts_creds_root=DATA_DIR)