class_docstr: Test class for the OneLoginApp
class_docstr_tok: ["Test","class","for","the","OneLoginApp"]
docstr: OneLoginApp - Get OneLogin Events, Rate Limited
docstr_tok: ["OneLoginApp","-","Get","OneLogin","Events",",","Rate","Limited"]
code: def test_get_onelogin_events_rate_limited(self, requests_mock):
      """OneLoginApp - Get OneLogin Events, Rate Limited"""
      self._app._auth_headers = True
      self._app._rate_limit_sleep = 1
      err_limit_response = Mock(
          status_code=400,
          json=Mock(
              return_value={
                  "message": "something went wrong",
                  "status": {
                      "code": 400,
                      "message": "rate_limit_exceeded",
                  },
              }
          ),
      )
      ok_limit_response = Mock(
          status_code=200,
          json=Mock(return_value={"data": {"X-RateLimit-Reset": 123}}),
      )
      requests_mock.side_effect = [
          err_limit_response,
          ok_limit_response,
      ]
      assert_false(self._app._get_onelogin_events())
      assert_equal(self._app._rate_limit_sleep, 123)
  
imports: import os
  from mock import Mock, patch
  from moto import mock_ssm
  from nose.tools import assert_equal, assert_false, assert_count_equal
  from streamalert.apps._apps.onelogin import OneLoginApp
  from tests.unit.streamalert.apps.test_helpers import get_event, put_mock_params
  from tests.unit.streamalert.shared.test_config import get_mock_lambda_context
label_desc: Use image node_id 12 for calling the TestOneLoginApp obj's underlying member method code with example usage: obj.test_get_onelogin_events_rate_limited(requests_mock) without return types