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 <noreply@anthropic.com>
This commit is contained in:
+2
-2
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user