summaryrefslogtreecommitdiff
path: root/openstackclient/tests/unit/volume/v1
diff options
context:
space:
mode:
Diffstat (limited to 'openstackclient/tests/unit/volume/v1')
-rw-r--r--openstackclient/tests/unit/volume/v1/test_volume.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/openstackclient/tests/unit/volume/v1/test_volume.py b/openstackclient/tests/unit/volume/v1/test_volume.py
index 54ec9e7e..e95f42d0 100644
--- a/openstackclient/tests/unit/volume/v1/test_volume.py
+++ b/openstackclient/tests/unit/volume/v1/test_volume.py
@@ -844,6 +844,8 @@ class TestVolumeSet(TestVolume):
('size', None),
('property', {'myprop': 'myvalue'}),
('volume', volume_fakes.volume_name),
+ ('bootable', False),
+ ('non_bootable', False)
]
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
@@ -858,3 +860,28 @@ class TestVolumeSet(TestVolume):
metadata
)
self.assertIsNone(result)
+
+ def test_volume_set_bootable(self):
+ arglist = [
+ ['--bootable', volume_fakes.volume_id],
+ ['--non-bootable', volume_fakes.volume_id]
+ ]
+ verifylist = [
+ [
+ ('bootable', True),
+ ('non_bootable', False),
+ ('volume', volume_fakes.volume_id)
+ ],
+ [
+ ('bootable', False),
+ ('non_bootable', True),
+ ('volume', volume_fakes.volume_id)
+ ]
+ ]
+ for index in range(len(arglist)):
+ parsed_args = self.check_parser(
+ self.cmd, arglist[index], verifylist[index])
+
+ self.cmd.take_action(parsed_args)
+ self.volumes_mock.set_bootable.assert_called_with(
+ volume_fakes.volume_id, verifylist[index][0][1])