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
dba5b490
Commit
dba5b490
authored
May 21, 2021
by
Gabriel Rodrigues
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests to check data handler attributes after update plots
parent
91b9edc4
Pipeline
#1570
failed with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
conftest.py
NativeUI/tests/unittests/conftest.py
+2
-1
test_handlers.py
NativeUI/tests/unittests/test_handlers.py
+6
-0
No files found.
NativeUI/tests/unittests/conftest.py
View file @
dba5b490
...
...
@@ -6,11 +6,12 @@ sys.path.append("/home/pi/hev/NativeUI")
from
NativeUI
import
NativeUI
from
widget_library.battery_display_widget
import
BatteryDisplayWidget
RESOLUTION_NativeUI
=
[
1620
,
910
]
@
pytest
.
fixture
(
scope
=
"session"
,
autouse
=
True
)
def
nat_widget
():
app
=
QApplication
(
sys
.
argv
)
nat_widget
=
NativeUI
()
nat_widget
=
NativeUI
(
RESOLUTION_NativeUI
)
return
nat_widget
...
...
NativeUI/tests/unittests/test_handlers.py
View file @
dba5b490
...
...
@@ -362,6 +362,7 @@ class TestDataHandler:
send_update_plots_signal method is called.
"""
display_updated
=
False
plots_database
=
self
.
data_handler
.
_DataHandler__plots_database
def
mock_display
(
new_status
:
dict
):
nonlocal
display_updated
...
...
@@ -370,3 +371,8 @@ class TestDataHandler:
self
.
data_handler
.
UpdatePlots
.
connect
(
mock_display
)
self
.
data_handler
.
send_update_plots_signal
()
assert
display_updated
is
True
,
"data handler did not emit UpdatePlots signal"
assert
plots_database
[
"timestamp"
][
-
1
]
==
0
assert
plots_database
[
"pressure"
][
-
1
]
==
16.122142791748047
assert
plots_database
[
"flow"
][
-
1
]
==
34.1150016784668
assert
plots_database
[
"volume"
][
-
1
]
==
46869.6953125
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