def assert_alerts(ea_inst, calls):
 assert (ea_inst.rules[0]['alert'][0].alert.call_count == len(calls))
 for (call_num, call_args) in enumerate(ea_inst.rules[0]['alert'][0].alert.call_args_list):
  assert (not any([(match['@timestamp'] not in calls[call_num]) for match in call_args[0][0]]))
  assert (len(call_args[0][0]) == len(calls[call_num]))

def assert_alerts ( ea_inst , calls ) : assert ( ea_inst . rules [ 0 ] [ 'alert' ] [ 0 ] . alert . call_count == len ( calls ) ) for ( call_num , call_args ) in enumerate ( ea_inst . rules [ 0 ] [ 'alert' ] [ 0 ] . alert . call_args_list ) : assert ( not any ( [ ( match [ '@timestamp' ] not in calls [ call_num ] ) for match in call_args [ 0 ] [ 0 ] ] ) ) assert ( len ( call_args [ 0 ] [ 0 ] ) == len ( calls [ call_num ] ) )
takes a list of lists of timestamps .