Merge "Unify the sensor data format"
This commit is contained in:
commit
3c1a8b8ff6
|
@ -276,11 +276,11 @@ def _get_sensors_data(driver_info):
|
|||
continue
|
||||
sensors_data.setdefault(reading.type,
|
||||
{})[reading.name] = {
|
||||
'Sensor Reading': reading.value,
|
||||
'Sensor Reading': '%s %s' % (reading.value, reading.units),
|
||||
'Sensor ID': reading.name,
|
||||
'States': reading.states,
|
||||
'States': str(reading.states),
|
||||
'Units': reading.units,
|
||||
'Health': reading.health}
|
||||
'Health': str(reading.health)}
|
||||
|
||||
return sensors_data
|
||||
|
||||
|
|
|
@ -155,26 +155,26 @@ class IPMINativePrivateMethodTestCase(base.TestCase):
|
|||
expected = {
|
||||
'fake_type_A': {
|
||||
'fake_name1': {
|
||||
'Health': 0,
|
||||
'Health': '0',
|
||||
'Sensor ID': 'fake_name1',
|
||||
'Sensor Reading': 'fake_value1',
|
||||
'States': [],
|
||||
'Sensor Reading': 'fake_value1 fake_units',
|
||||
'States': '[]',
|
||||
'Units': 'fake_units'
|
||||
},
|
||||
'fake_name2': {
|
||||
'Health': 0,
|
||||
'Health': '0',
|
||||
'Sensor ID': 'fake_name2',
|
||||
'Sensor Reading': 'fake_value2',
|
||||
'States': [],
|
||||
'Sensor Reading': 'fake_value2 fake_units',
|
||||
'States': '[]',
|
||||
'Units': 'fake_units'
|
||||
}
|
||||
},
|
||||
'fake_type_B': {
|
||||
'fake_name3': {
|
||||
'Health': 0,
|
||||
'Health': '0',
|
||||
'Sensor ID': 'fake_name3',
|
||||
'Sensor Reading': 'fake_value3',
|
||||
'States': [], 'Units': 'fake_units'
|
||||
'Sensor Reading': 'fake_value3 fake_units',
|
||||
'States': '[]', 'Units': 'fake_units'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -199,10 +199,10 @@ class IPMINativePrivateMethodTestCase(base.TestCase):
|
|||
expected = {
|
||||
'fake_type_A': {
|
||||
'fake_name1': {
|
||||
'Health': 0,
|
||||
'Health': '0',
|
||||
'Sensor ID': 'fake_name1',
|
||||
'Sensor Reading': 'fake_value1',
|
||||
'States': [],
|
||||
'Sensor Reading': 'fake_value1 fake_units',
|
||||
'States': '[]',
|
||||
'Units': 'fake_units'
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue