@then('the file "{filename}" should contain the log records')
def step_file_should_contain_log_records(context, filename):
 assert context.table, 'REQUIRE: context.table'
 context.table.require_columns(['category', 'level', 'message'])
 format = getattr(context, 'log_record_format', context.config.logging_format)
 for row in context.table.rows:
  output = LogRecordTable.make_output_for_row(row, format)
  context.text = output
  step_file_should_contain_multiline_text(context, filename)

@ then ( 'the file "{filename}" should contain the log records' ) def step_file_should_contain_log_records ( context , filename ) : assert context . table , 'REQUIRE: context.table' context . table . require_columns ( [ 'category' , 'level' , 'message' ] ) format = getattr ( context , 'log_record_format' , context . config . logging_format ) for row in context . table . rows : output = LogRecordTable . make_output_for_row ( row , format ) context . text = output step_file_should_contain_multiline_text ( context , filename )
verifies that the command output contains the specified log records .