summaryrefslogtreecommitdiff
path: root/novaclient/tests/unit/v2/test_volumes.py
diff options
context:
space:
mode:
Diffstat (limited to 'novaclient/tests/unit/v2/test_volumes.py')
-rw-r--r--novaclient/tests/unit/v2/test_volumes.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/novaclient/tests/unit/v2/test_volumes.py b/novaclient/tests/unit/v2/test_volumes.py
index d18f8466..93ea1c96 100644
--- a/novaclient/tests/unit/v2/test_volumes.py
+++ b/novaclient/tests/unit/v2/test_volumes.py
@@ -156,3 +156,26 @@ class VolumesV279Test(VolumesV249Test):
volume_id='15e59938-07d5-11e1-90e3-e3dffe0c5983',
delete_on_termination=True)
self.assertIn('delete_on_termination', str(ex))
+
+
+class VolumesV285Test(VolumesV279Test):
+ api_version = "2.85"
+
+ def test_volume_update_server_volume(self):
+ v = self.cs.volumes.update_server_volume(
+ server_id=1234,
+ src_volid='Work',
+ dest_volid='Work',
+ delete_on_termination=True
+ )
+ self.assert_request_id(v, fakes.FAKE_REQUEST_ID_LIST)
+ self.cs.assert_called('PUT',
+ '/servers/1234/os-volume_attachments/Work')
+ self.assertIsInstance(v, volumes.Volume)
+
+ def test_volume_update_server_volume_pre_v285(self):
+ self.cs.api_version = api_versions.APIVersion('2.84')
+ ex = self.assertRaises(
+ TypeError, self.cs.volumes.update_server_volume, "1234",
+ 'Work', 'Work', delete_on_termination=True)
+ self.assertIn('delete_on_termination', str(ex))