Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions linode_api4/objects/volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class Volume(Base):
"hardware_type": Property(),
"linode_label": Property(),
"encryption": Property(),
"io_ready": Property(),
}

def attach(self, to_linode, config=None):
Expand Down
12 changes: 8 additions & 4 deletions test/fixtures/volumes.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"tags": ["something"],
"filesystem_path": "this/is/a/file/path",
"hardware_type": "hdd",
"linode_label": null
"linode_label": null,
"io_ready": true
},
{
"id": 2,
Expand All @@ -26,7 +27,8 @@
"tags": [],
"filesystem_path": "this/is/a/file/path",
"hardware_type": "nvme",
"linode_label": null
"linode_label": null,
"io_ready": true
},
{
"id": 3,
Expand All @@ -40,7 +42,8 @@
"tags": ["attached"],
"filesystem_path": "this/is/a/file/path",
"hardware_type": "nvme",
"linode_label": "some_label"
"linode_label": "some_label",
"io_ready": true
},
{
"id": 4,
Expand All @@ -55,7 +58,8 @@
"filesystem_path": "this/is/a/file/path",
"hardware_type": "hdd",
"linode_label": null,
"encryption": "enabled"
"encryption": "enabled",
"io_ready": false
}
],
"results": 4,
Expand Down
1 change: 1 addition & 0 deletions test/integration/models/volume/test_volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def test_get_volume(test_linode_client, test_volume):
volume = test_linode_client.load(Volume, test_volume.id)

assert volume.id == test_volume.id
assert isinstance(volume.io_ready, bool)


def test_get_volume_with_encryption(
Expand Down
2 changes: 2 additions & 0 deletions test/unit/linode_client_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ def test_get_volumes(self):
self.assertEqual(v[1].linode_label, None)
self.assertEqual(v[2].filesystem_path, "this/is/a/file/path")
self.assertEqual(v[2].hardware_type, "nvme")
self.assertEqual(v[0].io_ready, True)
self.assertEqual(v[3].io_ready, False)

assert v[0].tags == ["something"]
assert v[1].tags == []
Expand Down
2 changes: 2 additions & 0 deletions test/unit/objects/volume_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ def test_get_volume(self):
self.assertEqual(volume.filesystem_path, "this/is/a/file/path")
self.assertEqual(volume.hardware_type, "hdd")
self.assertEqual(volume.linode_label, None)
self.assertEqual(volume.io_ready, True)

def test_get_volume_with_encryption(self):
volume = Volume(self.client, 4)
self.assertEqual(volume.io_ready, False)
self.assertEqual(volume.encryption, "enabled")

def test_update_volume_tags(self):
Expand Down
Loading