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

Function test_single_ent_selector

tests/test_shapes.py:365–387  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

363
364
365def test_single_ent_selector():
366
367 bs = box(1, 1, 1).moved((0, 0, 0), (2, 0, 0))
368
369 f = bs.face(">X")
370
371 assert isinstance(f, Face)
372
373 fs = bs.faces(">Z")
374
375 assert isinstance(fs, Compound)
376 assert isinstance(fs.face(), Face)
377
378 # check all options
379 assert isinstance(f.edge(">Z"), Edge)
380 assert isinstance(f.vertex(), Vertex)
381 assert isinstance(f.wire(">Z"), Wire)
382 assert isinstance(bs.shell(">X"), Shell)
383 assert isinstance(bs.solid(">X"), Solid)
384 assert isinstance(bs.face(NearestToPointSelector((0, 0, 1))), Face)
385
386 with raises(ValueError):
387 bs.face("%CYLINDER")
388
389
390def test_special():

Callers

nothing calls this directly

Calls 10

boxFunction · 0.90
vertexMethod · 0.80
solidMethod · 0.80
movedMethod · 0.45
faceMethod · 0.45
facesMethod · 0.45
edgeMethod · 0.45
wireMethod · 0.45
shellMethod · 0.45

Tested by

no test coverage detected