class_docstr: Test class for JSONParser
class_docstr_tok: ["Test","class","for","JSONParser"]
docstr: JSONParser - Nested records with missing keys
docstr_tok: ["JSONParser","-","Nested","records","with","missing","keys"]
code: def test_nested_records_with_missing_keys(self):
      """JSONParser - Nested records with missing keys"""
      options = {
          "schema": {"computer_name": "string", "group": "integer"},
          "configuration": {"json_path": "Records[*]"},
      }
  
      record_data = json.dumps(
          {
              "Records": [
                  {"computer_name": "foo", "group": 3},
                  {"computer_name": "foo-bar", "group": 3},
                  {
                      # Missing group key
                      "computer_name": "foo-bar-baz"
                  },
              ]
          }
      )
  
      # get parsed data
      parser = JSONParser(options)
      assert_equal(parser.parse(record_data), True)
  
      expected_valid_result = [
          {"computer_name": "foo", "group": 3},
          {"computer_name": "foo-bar", "group": 3},
      ]
  
      expected_invalid_result = [{"computer_name": "foo-bar-baz"}]
  
      assert_equal(parser.parsed_records, expected_valid_result)
      assert_equal(parser.invalid_parses, expected_invalid_result)
  
imports: import json
  from mock import patch
  from nose.tools import assert_equal
  from streamalert.classifier.parsers import JSONParser
label_desc: Use image node_id 19 for calling the TestJSONParser obj's underlying member method code with example usage: obj.test_nested_records_with_missing_keys() without return types