tests.test_broken_links moduleΒΆ
Tests for Sphinx linkcheck parsing, filtering, and report generation.
- tests.test_broken_links.test_get_label(repo, expected)[source]ΒΆ
Only a repo whose name starts with
awesome-gets the fix-link label.
- tests.test_broken_links.test_parse_output_json_empty_file(tmp_path)[source]ΒΆ
Empty file returns no results.
- tests.test_broken_links.test_parse_output_json_skips_blank_lines(tmp_path)[source]ΒΆ
Blank lines in the file are skipped.
- tests.test_broken_links.test_parse_output_json_single_entry(tmp_path)[source]ΒΆ
Single entry is parsed correctly.
- tests.test_broken_links.test_parse_output_json_multiple_entries(tmp_path)[source]ΒΆ
Multiple entries are parsed correctly.
- tests.test_broken_links.test_parse_output_json_missing_info_field(tmp_path)[source]ΒΆ
Missing info field defaults to empty string.
- tests.test_broken_links.test_filter_by_status(status, expected_count)[source]ΒΆ
Only broken and timeout statuses are kept.
- tests.test_broken_links.test_filter_broken_mixed_statuses()[source]ΒΆ
Only broken and timeout are kept from a mixed list.
- tests.test_broken_links.test_report_single_broken_link()[source]ΒΆ
Single broken link generates a valid report.
- tests.test_broken_links.test_report_groups_by_file_alphabetically()[source]ΒΆ
Results are grouped by filename in alphabetical order.
- tests.test_broken_links.test_report_escapes_pipe_chars_in_info()[source]ΒΆ
Pipe characters in info are escaped to avoid breaking tables.
- tests.test_broken_links.test_report_source_url_links_filenames_and_lines()[source]ΒΆ
When source_url is provided, filenames and line numbers are linked.
- tests.test_broken_links.test_report_no_source_url_plain_text()[source]ΒΆ
Without source_url, filenames and line numbers are plain text.
- tests.test_broken_links.test_report_leaves_external_content_unsanitized(info)[source]ΒΆ
The report renderer passes tool output through; the caller sanitizes it.
Splitting the two is what lets the same report be written to a file, where the mention would be inert, or posted to an issue, where it would not.
test_lychee_output_sanitizedcovers the callerβs half.