Files
skill-seekers-reference/tests/test_llms_txt_parser.py
Pablo Estevez 5ed767ff9a run ruff
2026-01-17 17:29:21 +00:00

35 lines
691 B
Python

from skill_seekers.cli.llms_txt_parser import LlmsTxtParser
def test_parse_markdown_sections():
"""Test parsing markdown into page sections"""
sample_content = """# Getting Started
Welcome to the docs.
## Installation
Run: npm install
## Usage
Import the library:
```javascript
import { app } from 'framework'
```
# API Reference
Main API documentation here.
"""
parser = LlmsTxtParser(sample_content)
pages = parser.parse()
assert len(pages) >= 2
assert pages[0]["title"] == "Getting Started"
assert pages[1]["title"] == "API Reference"
assert len(pages[0]["code_samples"]) == 1
assert pages[0]["code_samples"][0]["language"] == "javascript"