Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
OpenGEODE
Commits
01b8ece7
Commit
01b8ece7
authored
Apr 20, 2017
by
Maxime Perrotin
Browse files
Add skeleton of py.test-qt test
parent
ad07a896
Changes
2
Hide whitespace changes
Inline
Side-by-side
opengeode/opengeode.py
View file @
01b8ece7
...
...
@@ -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
:
...
...
tests/pytests/test_qt1.py
0 → 100755
View file @
01b8ece7
#!/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
))
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment