docstr: OutputCredentials - Load Credentials Loads from Cache Driver
  
  This test ensures that we only hit S3 once during, and that subsequent calls are routed
  to the Cache driver. Currently the cache driver is configured as Ephemeral.
docstr_tok: ["OutputCredentials","-","Load","Credentials","Loads","from","Cache","Driver","This","test","ensures","that","we","only","hit","S3","once","during",",","and","that","subsequent","calls","are","routed","to","the","Cache","driver",".","Currently","the","cache","driver","is","configured","as","Ephemeral","."]
code: def test_load_credentials_multiple(self):
      """OutputCredentials - Load Credentials Loads from Cache Driver
  
      This test ensures that we only hit S3 once during, and that subsequent calls are routed
      to the Cache driver. Currently the cache driver is configured as Ephemeral.
      """
  
      descriptor = "test_load_credentials_pulls_from_cache"
      props = OrderedDict(
          [
              (
                  "credential1",
                  OutputProperty(
                      description="Hello world",
                      value="there is no cow level",
                      mask_input=True,
                      cred_requirement=True,
                  ),
              ),
          ]
      )
  
      # Save credential
      self._provider.save_credentials(descriptor, KMS_ALIAS, props)
  
      # Pull it out (Normal expected behavior)
      creds_dict = self._provider.load_credentials(descriptor)
      expectation = {
          "credential1": "there is no cow level",
          "property2": "abcdef",
      }
      assert_equal(creds_dict, expectation)
  
      # Now we yank the SSM driver out of the driver pool
      # FIXME (derek.wang): Another way to do this is to install a spy on moto and make assertions
      #                     on the number of times it is called.
      assert_is_instance(self._provider._drivers[1], SSMDriver)
      self._provider._drivers[1] = None
      self._provider._core_driver = None
  
      # Load again and see if it still is able to load without SSM
      assert_equal(
          self._provider.load_credentials(descriptor), expectation
      )
  
      # Double-check; Examine the Driver guts and make sure that the EphemeralDriver has the
      # value cached.
      ep_driver = self._provider._drivers[0]
      assert_is_instance(ep_driver, EphemeralUnencryptedDriver)
  
      assert_true(ep_driver.has_credentials(descriptor))
      creds = ep_driver.load_credentials(descriptor)
      assert_equal(
          json.loads(creds.data())["credential1"],
          "there is no cow level",
      )
  
imports: import json
  import os
  from collections import OrderedDict
  from botocore.exceptions import ClientError
  from mock import patch, MagicMock
  from moto import mock_kms, mock_ssm
  from nose.tools import assert_equal, assert_false, assert_is_instance, assert_is_none, assert_is_not_none, assert_not_equal, assert_true
  from streamalert.alert_processor.outputs.output_base import OutputProperty
  from streamalert.alert_processor.outputs.credentials.provider import SSMDriver, LocalFileDriver, Credentials, OutputCredentialsProvider, EphemeralUnencryptedDriver, SpooledTempfileDriver, get_formatted_output_credentials_name
  from tests.unit.streamalert.alert_processor import PREFIX, CONFIG, KMS_ALIAS, REGION, MOCK_ENV
  from tests.unit.streamalert.alert_processor.helpers import encrypt_with_kms, setup_mock_kms
label_desc: Use image node_id 3 for calling the TestOutputCredentialsProvider obj's underlying member method code with example usage: obj.test_load_credentials_multiple() without return types