Files
skill-seekers-reference/tests
yusyus 6008f13127 test: Add comprehensive HTML detection tests for llms.txt downloader (PR #244 review fix)
Added 7 test cases to verify HTML redirect trap prevention:
- test_is_markdown_rejects_html_doctype() - DOCTYPE rejection (case-insensitive)
- test_is_markdown_rejects_html_tag() - <html> tag rejection
- test_is_markdown_rejects_html_meta() - <meta> and <head> tag rejection
- test_is_markdown_accepts_markdown_with_html_words() - Edge case: markdown mentioning "html"
- test_html_detection_only_scans_first_500_chars() - Performance optimization verification
- test_html_redirect_trap_scenario() - Real-world Claude Code redirect scenario
- test_download_rejects_html_redirect() - End-to-end download rejection

Addresses minor observation from PR #244 review:
- Ensures HTML detection logic is fully covered
- Prevents regression of redirect trap fixes
- Validates 500-char scanning optimization

Test Results: 20/20 llms_txt_downloader tests passing
Overall: 982/982 tests passing (4 expected failures - missing anthropic package)

Related: PR #244 (Claude Code documentation config update)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-11 14:16:44 +03:00
..