testing.link_crawl

Page actions AI-ready formats and sharing
Open LLM text
Share with AI
Ask Claude Ask ChatGPT Ask Gemini Ask Copilot

Link-integrity crawl helpers for shell apps (#234).

app.check() and TestClientstring asserts validate contracts but cannot prove that everyhrefthe shell renders resolves. These helpers render seed pages, collect same-origin paths…

Link-integrity crawl helpers for shell apps (#234).

app.check() and TestClientstring asserts validate contracts but cannot prove that everyhrefthe shell renders resolves. These helpers render seed pages, collect same-origin paths from the HTML, and GET each one — the cheap deterministic counterpart to a full browser smoke.

testing.link_crawl

Name Type Default Description
type
qualified_name
element_type
description
source_file
line_number
is_autodoc
autodoc_element
_autodoc_template
_autodoc_url_path
_autodoc_page_type
title
doc_content_hash

Symbols on this page

same_origin_paths
function
def same_origin_paths(html: str, *, skip_static: bool = True, skip_suffixes: Iterable[str] = _DEFAULT_SKIP_SUFFIXES) -> set[str]

Return crawlable same-origin paths embedded inhtml.

Strips#fragmentanchors and query strings, drops external schemes, relative non-root paths, static assets (whenskip_static=True), and paths ending with anyskip_suffixesentry (SSE streams, etc.).

Parameters

Name Type Default Description
html str
skip_static bool True
skip_suffixes Iterable[str] _DEFAULT_SKIP_SUFFIXES
LinkCrawlResult
class

Outcome of a link-integrity crawl.

crawl_links
function async
assert_link_integrity
function async

View source · /home/runner/work/chirp/chirp/site/../src/chirp/testing/link_crawl.py:1