return row_format.format("Device Path", "Type", "Size", "Rotates",
"Available", "Model")
else:
- return row_format.format(self.id, self.type if self.type is not None else "",
- format_bytes(self.size, 5, colored=False),
+ return row_format.format(str(self.id), self.type if self.type is not None else "",
+ format_bytes(self.size if self.size is not None else 0, 5,
+ colored=False),
str(self.rotates), str(self.available),
self.dev_id if self.dev_id is not None else "")
import pytest
-from orchestrator import DriveGroupSpec, DeviceSelection, DriveGroupValidationError
+from orchestrator import DriveGroupSpec, DeviceSelection, DriveGroupValidationError, InventoryDevice
def test_DriveGroup():
with pytest.raises(DriveGroupValidationError, match='exclusive'):
DeviceSelection(paths=['/dev/sda'], rotates=False)
+def test_inventory_device():
+ i_d = InventoryDevice()
+ s = i_d.pretty_print()
+ assert len(s)