Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SOHViewer
Manage
Activity
Members
Labels
Plan
Issues
14
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
5
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software Public
PASSOFT
SOHViewer
Commits
777f1c33
Commit
777f1c33
authored
2 years ago
by
Kien Le
Browse files
Options
Downloads
Patches
Plain Diff
Add tests for checkWFChan
parent
50ef46a2
No related branches found
Branches containing commit
No related tags found
1 merge request
!27
Draft: Add tests for functions in handling_data.py
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_model/test_handling_data.py
+43
-1
43 additions, 1 deletion
tests/test_model/test_handling_data.py
with
43 additions
and
1 deletion
tests/test_model/test_handling_data.py
+
43
−
1
View file @
777f1c33
...
...
@@ -644,4 +644,46 @@ class TestCheckSohChan(TestCase):
def
test_channel_not_requested
(
self
):
for
channel_id
in
self
.
sample_channel_ids
:
self
.
assertFalse
(
checkSOHChan
(
channel_id
,
self
.
req_soh_chans
))
\ No newline at end of file
self
.
assertFalse
(
checkSOHChan
(
channel_id
,
self
.
req_soh_chans
))
class
TestCheckWfChan
(
TestCase
):
def
setUp
(
self
)
->
None
:
self
.
req_wf_chans
=
[
'
LHE
'
,
'
HHE
'
]
self
.
sample_channel_ids
=
[
'
LHE
'
,
'
HHE
'
,
'
AL2
'
,
'
MNZ
'
,
'
VNN
'
]
def
test_all_channels_requested
(
self
):
self
.
req_wf_chans
=
[
'
*
'
]
with
self
.
subTest
(
'
test_waveform_channel
'
):
for
channel_id
in
self
.
sample_channel_ids
:
self
.
assertTupleEqual
(
checkWFChan
(
channel_id
,
self
.
req_wf_chans
),
(
'
WF
'
,
True
)
)
with
self
.
subTest
(
'
test_non_waveform_channel
'
):
channel_id
=
'
Not a waveform channel
'
self
.
assertTupleEqual
(
checkWFChan
(
channel_id
,
self
.
req_wf_chans
),
(
''
,
True
)
)
def
test_channel_is_requested
(
self
):
channel_id
=
'
LHE
'
self
.
assertTupleEqual
(
checkWFChan
(
channel_id
,
self
.
req_wf_chans
),
(
'
WF
'
,
True
)
)
def
test_channel_not_requested
(
self
):
with
self
.
subTest
(
'
test_waveform_channel
'
):
channel_id
=
'
AHE
'
self
.
assertTupleEqual
(
checkWFChan
(
channel_id
,
self
.
req_wf_chans
),
(
'
WF
'
,
False
)
)
with
self
.
subTest
(
'
test_non_waveform_channel
'
):
channel_id
=
'
Not a waveform channel
'
self
.
assertTupleEqual
(
checkWFChan
(
channel_id
,
self
.
req_wf_chans
),
(
''
,
False
)
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment