Update test_app.py to bring up to date with Mainline a2df6ff

This commit is contained in:
jdegenstein
2022-10-27 14:46:05 -05:00
committed by GitHub
parent ce68e6e120
commit ca706045ba

View File

@@ -1093,6 +1093,36 @@ def test_render_colors_console(main_clean):
qtbot.wait(100) qtbot.wait(100)
assert('Unknown color format' in log.toPlainText().splitlines()[-1]) assert('Unknown color format' in log.toPlainText().splitlines()[-1])
code_shading = \
'''
import cadquery as cq
res1 = cq.Workplane('XY').box(5, 7, 5)
res2 = cq.Workplane('XY').box(8, 5, 4)
show_object(res1)
show_object(res2,options={"alpha":0})
'''
def test_shading_aspect(main_clean):
qtbot, win = main_clean
obj_tree = win.components['object_tree']
editor = win.components['editor']
debugger = win.components['debugger']
editor.set_text(code_shading)
debugger._actions['Run'][0].triggered.emit()
CQ = obj_tree.CQ
# get material aspects
ma1 = CQ.child(0).ais.Attributes().ShadingAspect().Material()
ma2 = CQ.child(1).ais.Attributes().ShadingAspect().Material()
# verify that they are the same
assert ma1.Shininess() == ma2.Shininess()
def test_confirm_new(monkeypatch,editor): def test_confirm_new(monkeypatch,editor):
qtbot, editor = editor qtbot, editor = editor
@@ -1433,4 +1463,3 @@ def test_modulefinder(tmp_path, main):
qtbot.wait(100) qtbot.wait(100)
assert("Cannot determine imported modules" in log.toPlainText().splitlines()[-1]) assert("Cannot determine imported modules" in log.toPlainText().splitlines()[-1])