diff --git a/scripts/generate-llms-files.py b/scripts/generate-llms-files.py index 543456af..aa29be75 100755 --- a/scripts/generate-llms-files.py +++ b/scripts/generate-llms-files.py @@ -228,7 +228,7 @@ def build_llms_txt(pages: list[DocPage]) -> str: "", "> LLM-friendly index of OpenHands documentation (V1). Legacy V0 docs pages are intentionally excluded.", "", - "The sections below intentionally separate OpenHands product documentation (Web App Server / Cloud / CLI)", + "The sections below intentionally separate OpenHands applications documentation (Web App Server / Cloud / CLI)", "from the OpenHands Software Agent SDK.", "", ] diff --git a/tests/test_generate_llms_files.py b/tests/test_generate_llms_files.py new file mode 100644 index 00000000..775b8352 --- /dev/null +++ b/tests/test_generate_llms_files.py @@ -0,0 +1,30 @@ +"""Regression tests for the llms file generator.""" + +import importlib.util +import sys +from pathlib import Path + + +SCRIPT_PATH = Path(__file__).parent.parent / 'scripts' / 'generate-llms-files.py' +SPEC = importlib.util.spec_from_file_location('generate_llms_files', SCRIPT_PATH) +assert SPEC is not None +assert SPEC.loader is not None +MODULE = importlib.util.module_from_spec(SPEC) +sys.modules[SPEC.name] = MODULE +SPEC.loader.exec_module(MODULE) + + +class TestGenerateLlmsFiles: + """Tests for the llms file generator script.""" + + def test_llms_intro_uses_applications_wording(self): + """The llms intro should continue to use 'applications documentation'.""" + pages = MODULE.iter_doc_pages() + + llms_text = MODULE.build_llms_txt(pages) + + assert ( + 'The sections below intentionally separate OpenHands applications documentation ' + '(Web App Server / Cloud / CLI)' in llms_text + ) + assert 'OpenHands product documentation' not in llms_text