Update test_app.py to bring up to date with Mainline a2df6ff
This commit is contained in:
@@ -1018,13 +1018,13 @@ def test_render_colors(main_clean):
|
|||||||
|
|
||||||
# object 1 (defualt color)
|
# object 1 (defualt color)
|
||||||
assert not CQ.child(0).ais.HasColor()
|
assert not CQ.child(0).ais.HasColor()
|
||||||
|
|
||||||
# object 2
|
# object 2
|
||||||
r,g,b,a = get_rgba(CQ.child(1).ais)
|
r,g,b,a = get_rgba(CQ.child(1).ais)
|
||||||
assert( a == 0.5 )
|
assert( a == 0.5 )
|
||||||
assert( r == 1.0 )
|
assert( r == 1.0 )
|
||||||
assert( g == 0.0 )
|
assert( g == 0.0 )
|
||||||
|
|
||||||
# object 3
|
# object 3
|
||||||
r,g,b,a = get_rgba(CQ.child(2).ais)
|
r,g,b,a = get_rgba(CQ.child(2).ais)
|
||||||
assert( a == 0.5)
|
assert( a == 0.5)
|
||||||
@@ -1058,7 +1058,7 @@ def test_render_colors_console(main_clean):
|
|||||||
console = win.components['console']
|
console = win.components['console']
|
||||||
|
|
||||||
console.execute_command(code_color)
|
console.execute_command(code_color)
|
||||||
|
|
||||||
CQ = obj_tree.CQ
|
CQ = obj_tree.CQ
|
||||||
|
|
||||||
# object 1 (defualt color)
|
# object 1 (defualt color)
|
||||||
@@ -1092,7 +1092,37 @@ def test_render_colors_console(main_clean):
|
|||||||
# check if error occured
|
# check if error occured
|
||||||
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])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user