ввв
This commit is contained in:
@@ -304,3 +304,34 @@ Read health
|
||||
assert RagLayer.DOCS_INTEGRATION_INDEX in layers
|
||||
assert "docs integration parse warning" in caplog.text
|
||||
assert all(doc.source.path == "docs/api/health-endpoint.md" for doc in docs)
|
||||
|
||||
|
||||
def test_docs_pipeline_tolerates_broken_frontmatter_and_keeps_api_type() -> None:
|
||||
pipeline = DocsIndexingPipeline()
|
||||
content = """---
|
||||
id: api.control_actions_endpoint
|
||||
type: api_method
|
||||
doc_type: api_method
|
||||
title: HTTP API /actions/{action}
|
||||
endpoint: GET|POST /actions/{action}
|
||||
links:
|
||||
called_by:
|
||||
- ext.operator
|
||||
tags:
|
||||
- api
|
||||
---
|
||||
# HTTP API /actions/{action}
|
||||
|
||||
## Summary
|
||||
|
||||
Control actions endpoint.
|
||||
"""
|
||||
docs = pipeline.index_file(
|
||||
repo_id="acme/proj",
|
||||
commit_sha="abc123",
|
||||
path="docs/api/control-actions-endpoint.md",
|
||||
content=content,
|
||||
)
|
||||
catalog = next(doc for doc in docs if doc.layer == RagLayer.DOCS_DOCUMENT_CATALOG)
|
||||
assert catalog.metadata["type"] == "api_method"
|
||||
assert catalog.metadata["title"] == "HTTP API /actions/{action}"
|
||||
|
||||
Reference in New Issue
Block a user