Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
HEV - High Energy Ventilator
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
5
Issues
5
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
HEV - High Energy Ventilator
Commits
51fe1440
Commit
51fe1440
authored
Apr 09, 2021
by
Benjamin Mummery
💻
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ui_dev' of
https://ohwr.org/project/hev
into ui_dev
parents
07e47af0
ba136cde
Pipeline
#1205
canceled with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
11 deletions
+34
-11
test_sw11.py
tests/integration/test_sw11.py
+34
-11
No files found.
tests/integration/test_sw11.py
View file @
51fe1440
...
...
@@ -19,7 +19,7 @@ import os
import
sys
from
PySide2.QtWidgets
import
QApplication
import
time
import
threading
import
_thread
current_path
=
os
.
path
.
abspath
(
os
.
getcwd
())
root_path
=
os
.
path
.
abspath
(
current_path
+
"/NativeUI"
)
...
...
@@ -33,12 +33,8 @@ import hevclient
# Stub self.alarmTab.popup.addAlarm(newAbstractAlarm), self.alarmTab.list.addAlarm(newAbstractAlarm), self.alarmTableTab.table.addAlarmRow(newAbstractAlarm)
def
main
():
hevclient
.
mmFileName
=
"tests/integration/fixtures/HEVClient_lastData.mmap"
app
=
QApplication
()
myNativeUI
=
NativeUI
()
x
=
threading
.
Thread
(
target
=
app
.
exec_
)
x
.
start
()
def
sw11
(
NativeUI
):
myNativeUI
=
NativeUI
# define vars
popup_activated
=
False
...
...
@@ -78,20 +74,47 @@ def main():
# __define_connections calls alarm_widgets.tab_alarms.update_alarms every 16ms and starts when NativeUI is initialized.
starttime
=
time
.
time_ns
()
//
1_000_000
while
(
time
.
time_ns
()
//
1_000_000
)
<
(
starttime
+
5000
):
wait_time
=
5
count
=
0
while
count
<
wait_time
:
print
(
"waiting "
+
str
(
count
+
1
)
+
"s out of 5s"
)
count
=
count
+
1
time
.
sleep
(
1
)
pass
# (In Stubs) Capture newAbstractAlarm and query it for alarm code and priority set a flag if so.
print
(
"
\n
Running tests
\n
"
)
# After wait, check for flags set.
assert
popup_activated
is
True
,
"popup.addAlarm(newAbstractAlarm) not called."
assert
list_activated
is
True
,
"list.addAlarm(newAbstractAlarm) not called."
assert
table_activated
is
True
,
"table.addAlarm(newAbstractAlarm) not called."
x
.
join
()
return
def
main
():
hevclient
.
mmFileName
=
"tests/integration/fixtures/HEVClient_lastData.mmap"
app
=
QApplication
()
myNativeUI
=
NativeUI
()
_thread
.
start_new_thread
(
sw11
,
(
myNativeUI
,))
app
.
exec_
()
wait_time
=
5
count
=
0
while
count
<
wait_time
:
print
(
"waiting "
+
str
(
count
+
1
)
+
"s out of 5s"
)
count
=
count
+
1
time
.
sleep
(
1
)
pass
_thread
.
exit
()
sys
.
exit
()
return
main
()
\ No newline at end of file
if
__name__
==
"__main__"
:
main
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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