Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
adc-lib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
adc-lib
Commits
31723866
Commit
31723866
authored
Aug 10, 2020
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tst: fix python docstring
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
d1f07ef6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
test_adc_getter_setter.py
pytest/fmc-adc-100m14b4cha/test_adc_getter_setter.py
+10
-10
No files found.
pytest/fmc-adc-100m14b4cha/test_adc_getter_setter.py
View file @
31723866
...
...
@@ -20,21 +20,21 @@ class TestAdcGetterSetterBoard(object):
assert
conf
.
value_get
(
PyAdcConf
.
ADC_CONF_BRD_STATE_MACHINE_STATUS
)
==
1
def
test_adc_n_chan
(
self
,
adc100m14b4cha
):
"
Test that we can get the number of channels
"
"
""Test that we can get the number of channels""
"
conf
=
PyAdcConf
(
PyAdcConf
.
ADC_CONF_TYPE_BRD
,
0
)
conf
.
mask_set
(
PyAdcConf
.
ADC_CONF_BRD_N_CHAN
)
adc100m14b4cha
.
retrieve_config
(
conf
)
assert
conf
.
value_get
(
PyAdcConf
.
ADC_CONF_BRD_N_CHAN
)
==
4
def
test_adc_n_trg_ext
(
self
,
adc100m14b4cha
):
"
Test that we get the number of external triggers
"
"
""Test that we get the number of external triggers""
"
conf
=
PyAdcConf
(
PyAdcConf
.
ADC_CONF_TYPE_BRD
,
0
)
conf
.
mask_set
(
PyAdcConf
.
ADC_CONF_BRD_N_TRG_EXT
)
adc100m14b4cha
.
retrieve_config
(
conf
)
assert
conf
.
value_get
(
PyAdcConf
.
ADC_CONF_BRD_N_TRG_EXT
)
==
1
def
test_adc_n_trg_thr
(
self
,
adc100m14b4cha
):
"
Test that we get the number of threshold triggers
"
"
""Test that we get the number of threshold triggers""
"
conf
=
PyAdcConf
(
PyAdcConf
.
ADC_CONF_TYPE_BRD
,
0
)
conf
.
mask_set
(
PyAdcConf
.
ADC_CONF_BRD_N_CHAN
)
conf
.
mask_set
(
PyAdcConf
.
ADC_CONF_BRD_N_TRG_THR
)
...
...
@@ -43,7 +43,7 @@ class TestAdcGetterSetterBoard(object):
assert
conf
.
value_get
(
PyAdcConf
.
ADC_CONF_BRD_N_CHAN
)
==
4
def
test_adc_n_trg_ext
(
self
,
adc100m14b4cha
):
"
Test that we get the number of timer triggers
"
"
""Test that we get the number of timer triggers""
"
conf
=
PyAdcConf
(
PyAdcConf
.
ADC_CONF_TYPE_BRD
,
0
)
conf
.
mask_set
(
PyAdcConf
.
ADC_CONF_BRD_N_TRG_TIM
)
adc100m14b4cha
.
retrieve_config
(
conf
)
...
...
@@ -55,7 +55,7 @@ class TestAdcGetterSetterChannel(object):
@
pytest
.
mark
.
parametrize
(
"vref"
,
[
0x45
,
0x11
,
0x23
])
@
pytest
.
mark
.
parametrize
(
"channel"
,
range
(
4
))
def
test_adc_vref
(
self
,
adc100m14b4cha
,
vref
,
channel
):
"
Test that we can read/write vref on all channels
"
"
""Test that we can read/write vref on all channels""
"
conf
=
PyAdcConf
(
PyAdcConf
.
ADC_CONF_TYPE_CHN
,
channel
)
conf
.
value_set
(
PyAdcConf
.
ADC_CONF_CHN_RANGE
,
vref
)
assert
conf
.
value_get
(
PyAdcConf
.
ADC_CONF_CHN_RANGE
)
==
ctypes
.
c_uint32
(
vref
)
.
value
...
...
@@ -69,7 +69,7 @@ class TestAdcGetterSetterChannel(object):
@
pytest
.
mark
.
parametrize
(
"termination"
,
[
True
,
False
])
@
pytest
.
mark
.
parametrize
(
"channel"
,
range
(
4
))
def
test_adc_termination
(
self
,
adc100m14b4cha
,
termination
,
channel
):
"
Test that we can read/write termination on all channels
"
"
""Test that we can read/write termination on all channels""
"
conf
=
PyAdcConf
(
PyAdcConf
.
ADC_CONF_TYPE_CHN
,
channel
)
conf
.
value_set
(
PyAdcConf
.
ADC_CONF_CHN_TERMINATION
,
int
(
termination
))
assert
conf
.
value_get
(
PyAdcConf
.
ADC_CONF_CHN_TERMINATION
)
==
int
(
termination
)
...
...
@@ -83,7 +83,7 @@ class TestAdcGetterSetterChannel(object):
@
pytest
.
mark
.
parametrize
(
"offset"
,
range
(
-
5000000
,
5000000
+
1
,
100000
))
@
pytest
.
mark
.
parametrize
(
"channel"
,
range
(
4
))
def
test_adc_offset
(
self
,
adc100m14b4cha
,
offset
,
channel
):
"
Test that we can read/write offset on all channels
"
"
""Test that we can read/write offset on all channels""
"
conf
=
PyAdcConf
(
PyAdcConf
.
ADC_CONF_TYPE_CHN
,
channel
)
conf
.
value_set
(
PyAdcConf
.
ADC_CONF_CHN_OFFSET
,
offset
)
assert
conf
.
value_get
(
PyAdcConf
.
ADC_CONF_CHN_OFFSET
)
==
ctypes
.
c_uint32
(
offset
)
.
value
...
...
@@ -97,7 +97,7 @@ class TestAdcGetterSetterChannel(object):
@
pytest
.
mark
.
parametrize
(
"offset"
,
[
-
5000001
,
5000001
])
@
pytest
.
mark
.
parametrize
(
"channel"
,
range
(
4
))
def
test_adc_offset_invalid
(
self
,
adc100m14b4cha
,
offset
,
channel
):
"
Test that we can read/write offset on all channels
"
"
""Test that we can read/write offset on all channels""
"
conf
=
PyAdcConf
(
PyAdcConf
.
ADC_CONF_TYPE_CHN
,
channel
)
conf
.
value_set
(
PyAdcConf
.
ADC_CONF_CHN_OFFSET
,
offset
)
assert
conf
.
value_get
(
PyAdcConf
.
ADC_CONF_CHN_OFFSET
)
==
ctypes
.
c_uint32
(
offset
)
.
value
...
...
@@ -107,7 +107,7 @@ class TestAdcGetterSetterChannel(object):
@
pytest
.
mark
.
parametrize
(
"saturation"
,
range
(
0
,
0x7FFF
,
1000
))
@
pytest
.
mark
.
parametrize
(
"channel"
,
range
(
4
))
def
test_adc_saturation
(
self
,
adc100m14b4cha
,
saturation
,
channel
):
"
Test that we can read/write saturation on all channels
"
"
""Test that we can read/write saturation on all channels""
"
conf
=
PyAdcConf
(
PyAdcConf
.
ADC_CONF_TYPE_CHN
,
channel
)
conf
.
value_set
(
PyAdcConf
.
ADC_CONF_CHN_SATURATION
,
saturation
)
assert
conf
.
value_get
(
PyAdcConf
.
ADC_CONF_CHN_SATURATION
)
==
ctypes
.
c_uint32
(
saturation
)
.
value
...
...
@@ -121,7 +121,7 @@ class TestAdcGetterSetterChannel(object):
@
pytest
.
mark
.
parametrize
(
"saturation"
,
[
random
.
randrange
(
0x8000
,
0xFFFFFFFF
)
for
i
in
range
(
10
)])
@
pytest
.
mark
.
parametrize
(
"channel"
,
range
(
4
))
def
test_adc_saturation_invalid
(
self
,
adc100m14b4cha
,
saturation
,
channel
):
"
Test that we can read/write saturation on all channels
"
"
""Test that we can read/write saturation on all channels""
"
conf
=
PyAdcConf
(
PyAdcConf
.
ADC_CONF_TYPE_CHN
,
channel
)
conf
.
value_set
(
PyAdcConf
.
ADC_CONF_CHN_SATURATION
,
saturation
)
assert
conf
.
value_get
(
PyAdcConf
.
ADC_CONF_CHN_SATURATION
)
==
ctypes
.
c_uint32
(
saturation
)
.
value
...
...
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