tests.test_outputs module

Tests for repomatic.github.outputs step outputs and annotations.

tests.test_outputs.test_annotation_level_glyph(level, glyph)[source]

Each level opens its terminal line with its own symbol.

tests.test_outputs.test_report_finding_annotates_then_prints(level, capsys)[source]

The annotation and the terminal line always agree on the level.

tests.test_outputs.test_format_multiline_output_keeps_small_values_verbatim(value)[source]

Anything under the ceiling reaches the consuming step untouched.

tests.test_outputs.test_format_multiline_output_trims_oversized_values(filler, label)[source]

An oversized value is cut down to fit, whatever its encoding costs.

tests.test_outputs.test_format_multiline_output_leaves_room_for_the_variable_name()[source]

The trimmed value plus a NAME= prefix stays under MAX_ARG_STRLEN.

The kernel counts the whole NAME=value string against its per-string cap, so a value sized to the cap exactly would still fail to exec.

tests.test_outputs.test_trim_to_byte_budget_cuts_on_line_boundaries()[source]

A budget landing mid-line drops that line rather than splitting it.

tests.test_outputs.test_trim_to_byte_budget_returns_empty_when_nothing_fits()[source]

A budget too small for even the first line yields nothing.

tests.test_outputs.test_write_output_file_lands_in_the_runner_temp_dir(tmp_path, monkeypatch)[source]

The runner’s own temp dir holds the spill when it exports one.

tests.test_outputs.test_format_file_output_names_the_output_after_the_file(tmp_path, monkeypatch)[source]

The step output carries a path under a _file name, not the content.

tests.test_outputs.test_format_file_output_keeps_oversized_values_whole(tmp_path, monkeypatch)[source]

A report past the environment’s ceiling reaches the consumer intact.

tests.test_outputs.test_read_file_output_reads_the_file_the_variable_names(tmp_path, monkeypatch)[source]

The _FILE variable names the file whose content is the value.

tests.test_outputs.test_read_file_output_ignores_an_inline_value(monkeypatch)[source]

Only the path counts: a value passed inline is not read.

tests.test_outputs.test_file_output_round_trips(tmp_path, monkeypatch)[source]

What the producer spills is what the consumer reads back.

tests.test_outputs.test_emit_report_writes_scalar_outputs_beside_the_path(tmp_path, monkeypatch)[source]

Every output of the step lands in the one write the output file gets.

tests.test_outputs.test_emit_report_keeps_scalar_outputs_out_of_markdown(tmp_path)[source]

A markdown report is the report alone.

tests.test_outputs.test_emit_report_writes_nothing_without_a_body_or_a_path(tmp_path, body, output)[source]

An empty report and a missing --output both leave the disk alone.

tests.test_outputs.test_write_text_output_closes_the_file_it_opens(tmp_path, monkeypatch)[source]

The stream opened for a path is closed once written, flushing it.

tests.test_outputs.test_write_text_output_leaves_stdout_open(capsys)[source]

Writing to - never closes the live standard output.