MCPcopy
hub / github.com/CadQuery/cadquery / test_assembly_remove_part

Function test_assembly_remove_part

tests/test_assembly.py:2425–2442  ·  view source on GitHub ↗

Tests the ability to remove a part from an assembly.

()

Source from the content-addressed store, hash-verified

2423
2424
2425def test_assembly_remove_part():
2426 """
2427 Tests the ability to remove a part from an assembly.
2428 """
2429 assy = cq.Assembly()
2430 assy.add(box(1, 1, 1), name="part1")
2431 assy.add(box(2, 2, 2), name="part2", loc=cq.Location(5.0, 5.0, 5.0))
2432
2433 # Make sure we have the correct number of children (2 parts)
2434 assert len(assy.children) == 2
2435 assert len(assy.objects) == 3
2436
2437 # Remove the first part
2438 assy.remove("part1")
2439
2440 # Make sure we have the correct number of children (1 part)
2441 assert len(assy.children) == 1
2442 assert len(assy.objects) == 2
2443
2444
2445def test_assembly_remove_subassy():

Callers

nothing calls this directly

Calls 3

addMethod · 0.95
removeMethod · 0.95
boxFunction · 0.85

Tested by

no test coverage detected