Skip to content

Commit 245e3e6

Browse files
add ioready and tests
1 parent 3322091 commit 245e3e6

5 files changed

Lines changed: 14 additions & 4 deletions

File tree

‎linode_api4/objects/volume.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class Volume(Base):
5252
"hardware_type": Property(),
5353
"linode_label": Property(),
5454
"encryption": Property(),
55+
"io_ready": Property(),
5556
}
5657

5758
def attach(self, to_linode, config=None):

‎test/fixtures/volumes.json‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"tags": ["something"],
1313
"filesystem_path": "this/is/a/file/path",
1414
"hardware_type": "hdd",
15-
"linode_label": null
15+
"linode_label": null,
16+
"io_ready": true
1617
},
1718
{
1819
"id": 2,
@@ -26,7 +27,8 @@
2627
"tags": [],
2728
"filesystem_path": "this/is/a/file/path",
2829
"hardware_type": "nvme",
29-
"linode_label": null
30+
"linode_label": null,
31+
"io_ready": true
3032
},
3133
{
3234
"id": 3,
@@ -40,7 +42,8 @@
4042
"tags": ["attached"],
4143
"filesystem_path": "this/is/a/file/path",
4244
"hardware_type": "nvme",
43-
"linode_label": "some_label"
45+
"linode_label": "some_label",
46+
"io_ready": true
4447
},
4548
{
4649
"id": 4,
@@ -55,7 +58,8 @@
5558
"filesystem_path": "this/is/a/file/path",
5659
"hardware_type": "hdd",
5760
"linode_label": null,
58-
"encryption": "enabled"
61+
"encryption": "enabled",
62+
"io_ready": false
5963
}
6064
],
6165
"results": 4,

‎test/integration/models/volume/test_volume.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ def test_get_volume(test_linode_client, test_volume):
7777
volume = test_linode_client.load(Volume, test_volume.id)
7878

7979
assert volume.id == test_volume.id
80+
assert isinstance(volume.io_ready, bool)
8081

8182

8283
def test_get_volume_with_encryption(

‎test/unit/linode_client_test.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ def test_get_volumes(self):
177177
self.assertEqual(v[1].linode_label, None)
178178
self.assertEqual(v[2].filesystem_path, "this/is/a/file/path")
179179
self.assertEqual(v[2].hardware_type, "nvme")
180+
self.assertEqual(v[0].io_ready, True)
181+
self.assertEqual(v[3].io_ready, False)
180182

181183
assert v[0].tags == ["something"]
182184
assert v[1].tags == []

‎test/unit/objects/volume_test.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ def test_get_volume(self):
3030
self.assertEqual(volume.filesystem_path, "this/is/a/file/path")
3131
self.assertEqual(volume.hardware_type, "hdd")
3232
self.assertEqual(volume.linode_label, None)
33+
self.assertEqual(volume.io_ready, True)
3334

3435
def test_get_volume_with_encryption(self):
3536
volume = Volume(self.client, 4)
37+
self.assertEqual(volume.io_ready, False)
3638
self.assertEqual(volume.encryption, "enabled")
3739

3840
def test_update_volume_tags(self):

0 commit comments

Comments
 (0)