MCPcopy Create free account
hub / github.com/crewAIInc/crewAI / test_agents_md_docs_paths_exist

Function test_agents_md_docs_paths_exist

lib/cli/tests/test_create_crew.py:2853–2866  ·  view source on GitHub ↗
(shipped_agents_md)

Source from the content-addressed store, hash-verified

2851
2852
2853def test_agents_md_docs_paths_exist(shipped_agents_md):
2854 # Index lines end with a docs path relative to https://docs.crewai.com/en/.
2855 links = re.findall(
2856 r"`([a-z]+(?:/[a-z0-9-]+)+)(?:#([a-z0-9-]+))?`\s*$", shipped_agents_md, re.M
2857 )
2858 assert links, "AGENTS.md links no docs pages to check"
2859 nav = (DOCS / "docs.json").read_text(encoding="utf-8")
2860 for page, anchor in links:
2861 assert f'"edge/en/{page}"' in nav, f"{page} is not in the docs nav"
2862 if anchor:
2863 mdx = (DOCS / "edge/en" / f"{page}.mdx").read_text(encoding="utf-8")
2864 headings = re.findall(r"^#+ (.+)$", mdx, re.M)
2865 slugs = {re.sub(r"[^a-z0-9]+", "-", h.lower()).strip("-") for h in headings}
2866 assert anchor in slugs, f"{page} has no #{anchor} heading"

Callers

nothing calls this directly

Calls 1

read_textMethod · 0.80

Tested by

no test coverage detected