def test_read_smart_field_temperature(self): hwlst = [] line = 'Current Drive Temperature: 33 C' device = 'fake' item = 'Current Drive Temperature:' title = 'current_drive_temperature' smart_utils.read_smart_field(hwlst, line, device, item, title) self.assertEqual( hwlst, [('disk', 'fake', 'SMART/current_drive_temperature', '33'), ('disk', 'fake', 'SMART/current_drive_temperature_unit', 'C')])
def test_read_smart_field(self): hwlst = [] line = 'This is a test line' device = 'fake' item = 'test' title = 'fake_title' item_not_in_line = 'not_in_line' smart_utils.read_smart_field(hwlst, line, device, item_not_in_line, title) self.assertEqual(hwlst, []) smart_utils.read_smart_field(hwlst, line, device, item, title) self.assertEqual(hwlst, [('disk', 'fake', 'SMART/fake_title', 'line')])