tests.test_tabular moduleΒΆ

Tests for the shared CSV read, render and write helpers.

tests.test_tabular.COMMITTED_STORES = ('docs/assets/binaries.csv', 'docs/assets/metrics.csv', 'docs/assets/virustotal-scans.csv')ΒΆ

Every CSV this repository commits, which all go through these helpers.

tests.test_tabular.test_render_csv_round_trips(tmp_path)[source]ΒΆ

Check what is rendered reads back as the same cells.

tests.test_tabular.test_render_csv_quotes_a_cell_carrying_a_separator()[source]ΒΆ

Check a comma or a newline inside a cell cannot split a row.

tests.test_tabular.test_render_csv_uses_unix_newlines()[source]ΒΆ

Check the output is platform-independent.

These files are committed, so a \r\n from a Windows runner would churn the whole file against what a Unix runner wrote.

tests.test_tabular.test_read_csv_tolerates_a_missing_file(tmp_path)[source]ΒΆ

Check a first run reads no rows rather than failing.

tests.test_tabular.test_read_csv_is_loud_on_a_headerless_file(tmp_path)[source]ΒΆ

Check a truncated file raises rather than reading as empty.

Reading it as empty would let the next write clobber whatever survived.

tests.test_tabular.test_write_csv_is_convergent(tmp_path)[source]ΒΆ

Check rewriting identical content touches nothing.

Comparing before writing is what keeps a scheduled regeneration a no-op rather than a commit.

tests.test_tabular.test_write_if_changed_carries_any_format(tmp_path)[source]ΒΆ

The convergent write is about the write, not about CSV.

write_csv is a thin alias over it, and the SVG charts use it directly, so the primitive is checked here on content no CSV reader would accept.

tests.test_tabular.test_committed_stores_are_readable(relative)[source]ΒΆ

Check every CSV this repository commits parses and carries rows.

These are written unattended by scheduled and release jobs, so a header that drifted or a half-written file would otherwise surface as a broken docs page rather than a red test.