class_docstr: Test class for CSVParser
class_docstr_tok: ["Test","class","for","CSVParser"]
docstr: CSVParser - CSV within JSON
docstr_tok: ["CSVParser","-","CSV","within","JSON"]
code: def test_csv_parsing_from_json(self):
      """CSVParser - CSV within JSON"""
      options = {
          "schema": self._default_schema(),
          "configuration": {
              "envelope_keys": {
                  "env_key_01": "string",
                  "env_key_02": "string",
              },
              "json_path": "logEvents[*].message",
          },
      }
  
      data = json.dumps(
          {
              "env_key_01": "DATA_MESSAGE",
              "env_key_02": "123456789012",
              "logEvents": [
                  {
                      "uuid": "0F08CD2B-F21D-4F3A-9231-B527AD42AB91",
                      "message": "host-name,01-01-2018,contents",
                  },
                  {
                      "uuid": "0F08CD2B-F21D-4F3A-9231-B527AD42AB91",
                      "message": "host-name-02,02-02-2018,contents-02",
                  },
              ],
          }
      )
  
      # get parsed data
      parser = CSVParser(options)
      result = parser.parse(data)
      assert_equal(result, True)
  
      expected_result = [
          {
              "host": "host-name",
              "date": "01-01-2018",
              "message": "contents",
              "streamalert:envelope_keys": {
                  "env_key_01": "DATA_MESSAGE",
                  "env_key_02": "123456789012",
              },
          },
          {
              "host": "host-name-02",
              "date": "02-02-2018",
              "message": "contents-02",
              "streamalert:envelope_keys": {
                  "env_key_01": "DATA_MESSAGE",
                  "env_key_02": "123456789012",
              },
          },
      ]
  
      assert_equal(parser.parsed_records, expected_result)
  
file_path: streamalert/tests/unit/streamalert/classifier/test_parsers_csv.py
imports: from collections import OrderedDict
  import json
  from nose.tools import assert_equal
  from streamalert.classifier.parsers import CSVParser
label_desc: Use image node_id 6 for calling the TestCSVParser obj's underlying member method code with example usage: obj.test_csv_parsing_from_json() without return types