docstr: Create a properly formatted Kinesis, S3, or SNS record.
  
  Supports a dictionary or string based data record.  Reads in
  event templates from the tests/integration/templates folder.
  
  Args:
      config (dict): The loaded configuration
  
  Returns:
      dict: in the format of the specific service
docstr_tok: ["Create","a","properly","formatted","Kinesis",",","S3",",","or","SNS","record",".","Supports","a","dictionary","or","string","based","data","record",".","Reads","in","event","templates","from","the","tests\/integration\/templates","folder",".","Args",":","config","(","dict",")",":","The","loaded","configuration","Returns",":","dict",":","in","the","format","of","the","specific","service"]
code: def format_test_record(self, config):
      """Create a properly formatted Kinesis, S3, or SNS record.
  
      Supports a dictionary or string based data record.  Reads in
      event templates from the tests/integration/templates folder.
  
      Args:
          config (dict): The loaded configuration
  
      Returns:
          dict: in the format of the specific service
      """
      self._apply_helpers()
      self._apply_defaults(config)
  
      rec_data = self.data
      if isinstance(rec_data, dict):
          rec_data = json.dumps(rec_data)
      elif not isinstance(self.data, str):
          self.error = "Invalid data type: {}".format(type(rec_data))
          return False
  
      if self._event["service"] not in {
          "s3",
          "kinesis",
          "sns",
          "streamalert_app",
      }:
          self.error = "Unsupported service: {}".format(self.service)
          return False
  
      # Set a formatted record for this particular service
      self.record = self._apply_service_template(rec_data)
  
      return True
  
imports: import base64
  import json
  import re
  import time
  import zlib
  from mock import patch
  from streamalert.classifier.parsers import ParserBase
  from streamalert.shared import rule
  from streamalert.shared.logger import get_logger
  from streamalert_cli.test.mocks import LookupTableMocks, ThreatIntelMocks
label_desc: Use image node_id 22 for calling the TestEvent obj's underlying member method code with example usage: obj.format_test_record(config) and returns: True, False, False