Files
lancedb/ci/tests/test_extract_sdk_doc_links.py
Xuanwo 181ac2b567 test: match SDK documentation fallback URL (#4875)
Update the SDK documentation-link CI assertion to match the production
fallback URL introduced by #4870.

#4870 changed `rust/lancedb/src/docs.rs` from `/enterprise` to
`/basics/embedded-vs-enterprise`. The extractor already reads that
source, but its regression test still expected the old value. Keep the
assertion and update only the expected URL.

Verification: `python -m unittest discover -s ci/tests -v` passes 35/35
on Python 3.12. The same command on main `3c4aaa8e` fails only
`test_extracts_all_links_from_repo_docs_rs`.
2026-11-05 19:43:12 +08:00

48 lines
1.4 KiB
Python

# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright The LanceDB Authors
from pathlib import Path
import sys
from tempfile import TemporaryDirectory
import unittest
sys.path.insert(0, str(Path(__file__).resolve().parents[2]))
from ci.extract_sdk_doc_links import extract_doc_links, main
class TestExtractSdkDocLinks(unittest.TestCase):
def test_extracts_all_links_from_repo_docs_rs(self) -> None:
urls = extract_doc_links()
self.assertIn(
"https://docs.lancedb.com/performance#compaction-and-cleanup",
urls,
)
self.assertIn(
"https://docs.lancedb.com/indexing/reindexing#incremental-reindexing",
urls,
)
self.assertIn(
"https://docs.lancedb.com/search/sql",
urls,
)
self.assertIn(
"https://docs.lancedb.com/basics/embedded-vs-enterprise",
urls,
)
def test_cli_writes_markdown(self) -> None:
with TemporaryDirectory() as tmp:
out = Path(tmp) / "sdk-links.md"
rc = main(["--output", str(out)])
self.assertEqual(rc, 0)
content = out.read_text(encoding="utf-8")
self.assertIn(
"<https://docs.lancedb.com/performance#compaction-and-cleanup>",
content,
)
if __name__ == "__main__":
unittest.main()