samples: sensor: sensor_shell: update pytest to validate fix
Update the pytest script to exercise the entire `sensor_channel_name` table with `parse_named_int()`. The `gauge_desired_charging_current` is selected because it is the last one in the table before `all`, `all` is not used because `sensor get sensor@0 all` doesn't return anything. Signed-off-by: Yong Cong Sin <ycsin@meta.com>
This commit is contained in:
parent
eb37b8620b
commit
c13105750d
1 changed files with 5 additions and 0 deletions
|
@ -27,6 +27,11 @@ def test_sensor_shell_get(shell: Shell):
|
|||
lines = shell.exec_command('sensor get sensor@1 53')
|
||||
assert any(['channel type=53(gauge_time_to_empty)' in line for line in lines]), 'expected response not found'
|
||||
|
||||
# Channel should be the last one before 'all' (because 'all' doesn't print anything) so that the
|
||||
# for-loop in `parse_named_int()` will go through everything
|
||||
lines = shell.exec_command('sensor get sensor@0 gauge_desired_charging_current')
|
||||
assert any(['channel type=58(gauge_desired_charging_current)' in line for line in lines]), 'expected response not found'
|
||||
|
||||
logger.info('response is valid')
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue