Commit 01b8ece7 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Add skeleton of py.test-qt test

parent ad07a896
......@@ -406,7 +406,7 @@ class SDL_Scene(QtGui.QGraphicsScene, object):
self.button_selected = None
self.setBackgroundBrush(QtGui.QBrush(
QtGui.QImage(':icons/texture.png')))
self.messages_window = None
self.messages_window = QtGui.QListWidget() # default
self.click_coordinates = None
self.orig_pos = None
# When connecting symbols, store list of intermediate points
......@@ -426,6 +426,10 @@ class SDL_Scene(QtGui.QGraphicsScene, object):
self.highlighted = {}
self.refresh_requested = False
def close(self):
''' close function is needed by py.test-qt '''
pass
def set_readonly(self, readonly=True):
''' Set the current scene as read-only, discard all new actions '''
if self.context == 'process' and readonly:
......
#!/usr/bin/env python
from opengeode.opengeode import SDL_Scene
from opengeode.sdlSymbols import Label, Decision
def test_1(qtbot):
''' Test the parsing of numbers '''
scene = SDL_Scene(context="process")
qtbot.addWidget(scene)
scene.add_symbol(Label)
# test = parser_init(string='''provided true=false; priority 5;''')
# res = test.continuous_signal()
# assert(not isinstance(res.tree, antlr3.tree.CommonErrorNode))
if __name__ == '__main__':
for name, value in dict(globals()).viewitems():
if name.startswith('test_'):
print('---- Executing {} ----'.format(name))
value()
print('---- Done - {} ----\n'.format(name))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment