class_docstr: Test class for the SalesforceApp
class_docstr_tok: ["Test","class","for","the","SalesforceApp"]
docstr: SalesforceApp - Request auth token successfully
docstr_tok: ["SalesforceApp","-","Request","auth","token","successfully"]
code: def test_request_token_succeeded(self, mock_post):
      """SalesforceApp - Request auth token successfully"""
      self.set_config_values(
          "CLIENT_ID",
          "CLIENT_SECRET",
          "USERNAME",
          "PASSWORD",
          "SECURITY_TOKEN",
      )
  
      # request post is successful but return value is None.
      mock_post.return_value = Mock(
          status_code=200, json=Mock(return_value=None)
      )
      assert_false(self._app._request_token())
  
      # request post is successful and returns auth token.
      mock_post.return_value = Mock(
          status_code=200,
          json=Mock(
              return_value={
                  "access_token": "AUTH_TOKEN",
                  "instance_url": "MY_URL",
              }
          ),
      )
      assert_true(self._app._request_token())
      assert_equal(
          self._app._auth_headers,
          {
              "Content-Type": "application/json",
              "Authorization": "Bearer AUTH_TOKEN",
          },
      )
      assert_equal(self._app._instance_url, "MY_URL")
  
imports: import os
  from mock import Mock, patch
  from moto import mock_ssm
  from nose.tools import assert_equal, assert_false, assert_true, assert_count_equal, raises
  from requests.exceptions import Timeout
  from streamalert.apps._apps.salesforce import SalesforceApp, SalesforceAppError
  from tests.unit.streamalert.apps.test_helpers import get_event, get_salesforce_log_files, list_salesforce_api_versions, put_mock_params
  from tests.unit.streamalert.shared.test_config import get_mock_lambda_context
label_desc: Use image node_id 3 for calling the TestSalesforceApp obj's underlying member method code with example usage: obj.test_request_token_succeeded(mock_post) without return types