text
stringlengths
0
828
""""""
assert context.table, ""REQUIRE: context.table""
context.table.require_columns([""category"", ""level"", ""message""])
for row in context.table.rows:
category = row[""category""]
if category == ""__ROOT__"":
category = None
level = LogLevel.parse_type(row[""level""])
message = row[""message""]
make_log_record(category, level, message)"
1882,"def step_I_create_logrecord_with_table(context):
""""""
Create an log record by using a table to provide the parts.
.. seealso: :func:`step_I_create_logrecords_with_table()`
""""""
assert context.table, ""REQUIRE: context.table""
assert len(context.table.rows) == 1, ""REQUIRE: table.row.size == 1""
step_I_create_logrecords_with_table(context)"
1883,"def step_command_output_should_contain_log_records(context):
""""""
Verifies that the command output contains the specified log records
(in any order).
.. code-block: gherkin
Then the command output should contain the following log records:
| category | level | message |
| bar | CURRENT | xxx |
""""""
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.execute_steps(u'''
Then the command output should contain:
""""""
{expected_output}
""""""
'''.format(expected_output=output))"
1884,"def step_command_output_should_not_contain_log_records(context):
""""""
Verifies that the command output contains the specified log records
(in any order).
.. code-block: gherkin
Then the command output should contain the following log records:
| category | level | message |
| bar | CURRENT | xxx |
""""""
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.execute_steps(u'''
Then the command output should not contain:
""""""
{expected_output}
""""""
'''.format(expected_output=output))"
1885,"def step_command_output_should_contain_log_records_from_categories(context):
""""""
Verifies that the command output contains the specified log records
(in any order).
.. code-block: gherkin
Given I define a log record schema:
| category | level | message |
| root | ERROR | __LOG_MESSAGE__ |
Then the command output should contain log records from categories:
| category |
| bar |
""""""
assert context.table, ""REQUIRE: context.table""
context.table.require_column(""category"")
record_schema = context.log_record_row_schema
LogRecordTable.annotate_with_row_schema(context.table, record_schema)
step_command_output_should_contain_log_records(context)
context.table.remove_columns([""level"", ""message""])"
1886,"def step_command_output_should_not_contain_log_records_from_categories(context):
""""""
Verifies that the command output contains not log records from
the provided log categories (in any order).
.. code-block: gherkin
Given I define the log record schema:
| category | level | message |
| root | ERROR | __LOG_MESSAGE__ |
Then the command output should not contain log records from categories:
| category |
| bar |
""""""
assert context.table, ""REQUIRE: context.table""
context.table.require_column(""category"")
record_schema = context.log_record_row_schema