From f60f69846d24ef0e1582c44f3bd538bf1e2e6e9b Mon Sep 17 00:00:00 2001 From: Ni Jingzhe <1448976235@qq.com> Date: Tue, 10 Nov 2026 04:17:28 +0800 Subject: [PATCH] tests: the editor's API index test expects Part to take `body` and no `bodies` DECISION: update test_editor.py::ApiIndexTest::test_classes_list_their_constructor_without_private_fields to the one-solid constructor: `part_id` and `body` are required, `bodies` is not a parameter. WHY: the test said "a Part takes one body or several bodies (multi-body parts), so only part_id is required". A Part holds exactly one solid since "part: a Part holds exactly one solid" in this series (owner's decision, see design-docs/part-holds-one-solid.md), so `body` is required and `bodies` must not appear in the editor's index of the SDK constructor signatures (the index is what the editor's forms and completion read). An earlier commit of the series ("editor: several open solids have no product ...") fixed the first assertion of this test but left this one, which a full run of the suite caught (the earlier run of the editor test files had passed it only because the test then still matched the stale index). Checked: test_editor.py::ApiIndexTest passes (6 tests). Co-Authored-By: Claude Sonnet 5.5 --- test/test_editor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_editor.py b/test/test_editor.py index 2eece3cf..c2d0b038 100644 --- a/test/test_editor.py +++ b/test/test_editor.py @@ -865,10 +865,10 @@ class ApiIndexTest(unittest.TestCase): part = self.scad["Part"] self.assertEqual(part["k"], "c") names = [p["n"] for p in part["p"]] - # a Part takes one ``body`` or several ``bodies`` (multi-body parts), so only part_id is required + # a Part holds exactly one solid: ``part_id`` and ``body`` are required, there is no ``bodies`` self.assertEqual([p["n"] for p in part["p"] if p["r"]], ["part_id", "body"]) self.assertIn("body", names) - self.assertIn("bodies", names) + self.assertNotIn("bodies", names) self.assertFalse([n for n in names if n.startswith("_")]) def test_namespaces_and_submodules(self) -> None: