Commit f6f3a3d0 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Update test case

parent 00998fe6
......@@ -4,16 +4,33 @@ import pytest
from PySide import QtCore
from opengeode.opengeode import SDL_Scene, SDL_View
from opengeode.sdlSymbols import Label, Decision
from opengeode.ogParser import parser_init, floating_label
from opengeode.ogAST import Process
TEST_DATA = '''
/* CIF label (275, 194), (70, 35) */
connection p0:
/* CIF decision (275, 249), (70, 50) */
decision d;
/* CIF ANSWER (230, 319), (70, 23) */
(a):
/* CIF ANSWER (320, 319), (70, 23) */
(b):
enddecision;
/* CIF End Label */
endconnection;
'''
def test_1(qtbot):
''' Test the parsing of numbers '''
test = parser_init(string=TEST_DATA)
parsed = test.floating_label()
ast, err, warn = floating_label(parsed.tree, parent=None, context=Process())
scene = SDL_Scene(context="process")
scene.add_symbol(Label)
view = SDL_View (scene)
view.show()
qtbot.addWidget(view)
qtbot.keyClick(view,25)
# assert(not isinstance(res.tree, antlr3.tree.CommonErrorNode))
scene.render_everything(ast)
assert (ast == None)
assert (len(list(scene.visible_symb)))
if __name__ == '__main__':
......
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