original_docstring: Provide some additional context on why this test failed. This will
          perform some analysis of the test record to determine which keys are
          missing or which unnecessary keys are causing the test to fail. Any
          errors are appended to a list of errors so they can be printed at
          the end of the test run.
  
          Args:
              file_name (str): Name of file containing the test event
              test_event (dict): Actual record data being tested
          
docstring: Provide some additional context on why this test failed. This will
  perform some analysis of the test record to determine which keys are
  missing or which unnecessary keys are causing the test to fail. Any
  errors are appended to a list of errors so they can be printed at
  the end of the test run.
docstring_tokens: Provide some additional context on why this test failed . This will perform some analysis of the test record to determine which keys are missing or which unnecessary keys are causing the test to fail . Any errors are appended to a list of errors so they can be printed at the end of the test run .
code: def analyze_record_delta(self, file_name, test_event):
          """Provide some additional context on why this test failed. This will
          perform some analysis of the test record to determine which keys are
          missing or which unnecessary keys are causing the test to fail. Any
          errors are appended to a list of errors so they can be printed at
          the end of the test run.
  
          Args:
              file_name (str): Name of file containing the test event
              test_event (dict): Actual record data being tested
          """
          base_message = ('Invalid test event in file \'{}.json\' with description '
                          '\'{}\'.'.format(file_name, test_event['description']))
  
          if not self.check_log_declared_in_sources(base_message, test_event):
              return
  
          log_type = test_event['log']
          if log_type not in self.cli_config['logs']:
              message = ('{} Log (\'{}\') declared in test event does not exist in '
                         'logs.json'.format(base_message, log_type))
  
              self.status_messages.append(StatusMessage(StatusMessage.FAILURE, message))
              return
  
          config_log_info = self.cli_config['logs'][log_type]
          schema_keys = config_log_info['schema']
  
          envelope_keys = config_log_info.get('configuration', {}).get('envelope_keys')
          if envelope_keys:
              if self.report_envelope_key_error(base_message, envelope_keys, test_event['data']):
                  return
  
          # Check is a json path is used for nested records
          json_path = config_log_info.get('configuration', {}).get('json_path')
          if json_path:
              records_jsonpath = jsonpath_rw.parse(json_path)
              for match in records_jsonpath.find(test_event['data']):
                  self.report_record_delta(base_message, log_type, schema_keys, match.value)
  
              return
  
          self.report_record_delta(base_message, log_type, schema_keys, test_event['data'])
code_tokens: def analyze_record_delta ( self , file_name , test_event ) : base_message = ( 'Invalid test event in file \'{}.json\' with description ' '\'{}\'.' . format ( file_name , test_event [ 'description' ] ) ) if not self . check_log_declared_in_sources ( base_message , test_event ) : return log_type = test_event [ 'log' ] if log_type not in self . cli_config [ 'logs' ] : message = ( '{} Log (\'{}\') declared in test event does not exist in ' 'logs.json' . format ( base_message , log_type ) ) self . status_messages . append ( StatusMessage ( StatusMessage . FAILURE , message ) ) return config_log_info = self . cli_config [ 'logs' ] [ log_type ] schema_keys = config_log_info [ 'schema' ] envelope_keys = config_log_info . get ( 'configuration' , { } ) . get ( 'envelope_keys' ) if envelope_keys : if self . report_envelope_key_error ( base_message , envelope_keys , test_event [ 'data' ] ) : return json_path = config_log_info . get ( 'configuration' , { } ) . get ( 'json_path' ) if json_path : records_jsonpath = jsonpath_rw . parse ( json_path ) for match in records_jsonpath . find ( test_event [ 'data' ] ) : self . report_record_delta ( base_message , log_type , schema_keys , match . value ) return self . report_record_delta ( base_message , log_type , schema_keys , test_event [ 'data' ] )
short_docstring: Provide some additional context on why this test failed.
short_docstring_tokens: Provide some additional context on why this test failed .
comment: """Provide some additional context on why this test failed. This will
          perform some analysis of the test record to determine which keys are
          missing or which unnecessary keys are causing the test to fail. Any
          errors are appended to a list of errors so they can be printed at
          the end of the test run.
  
          Args:
              file_name (str): Name of file containing the test event
              test_event (dict): Actual record data being tested
          """$SEP$# Check is a json path is used for nested records