Merge "Explicit set capabilities in VolumeDetail and SnapshotDetail"
This commit is contained in:
commit
f0b45f3f58
|
@ -57,6 +57,13 @@ class SnapshotDetail(Snapshot):
|
|||
|
||||
base_path = "/snapshots/detail"
|
||||
|
||||
# capabilities
|
||||
allow_fetch = False
|
||||
allow_create = False
|
||||
allow_delete = False
|
||||
allow_commit = False
|
||||
allow_list = True
|
||||
|
||||
#: The percentage of completeness the snapshot is currently at.
|
||||
progress = resource.Body("os-extended-snapshot-attributes:progress")
|
||||
#: The project ID this snapshot is associated with.
|
||||
|
|
|
@ -94,6 +94,13 @@ class VolumeDetail(Volume):
|
|||
|
||||
base_path = "/volumes/detail"
|
||||
|
||||
# capabilities
|
||||
allow_fetch = False
|
||||
allow_create = False
|
||||
allow_delete = False
|
||||
allow_commit = False
|
||||
allow_list = True
|
||||
|
||||
#: The volume's current back-end.
|
||||
host = resource.Body("os-vol-host-attr:host")
|
||||
#: The project ID associated with current back-end.
|
||||
|
|
|
@ -77,6 +77,11 @@ class TestSnapshotDetail(base.TestCase):
|
|||
sot = snapshot.SnapshotDetail(DETAILED_SNAPSHOT)
|
||||
self.assertIsInstance(sot, snapshot.Snapshot)
|
||||
self.assertEqual("/snapshots/detail", sot.base_path)
|
||||
self.assertFalse(sot.allow_fetch)
|
||||
self.assertFalse(sot.allow_commit)
|
||||
self.assertFalse(sot.allow_create)
|
||||
self.assertFalse(sot.allow_delete)
|
||||
self.assertTrue(sot.allow_list)
|
||||
|
||||
def test_create_detailed(self):
|
||||
sot = snapshot.SnapshotDetail(**DETAILED_SNAPSHOT)
|
||||
|
|
|
@ -126,6 +126,11 @@ class TestVolumeDetail(base.TestCase):
|
|||
sot = volume.VolumeDetail(VOLUME_DETAIL)
|
||||
self.assertIsInstance(sot, volume.Volume)
|
||||
self.assertEqual("/volumes/detail", sot.base_path)
|
||||
self.assertFalse(sot.allow_fetch)
|
||||
self.assertFalse(sot.allow_commit)
|
||||
self.assertFalse(sot.allow_create)
|
||||
self.assertFalse(sot.allow_delete)
|
||||
self.assertTrue(sot.allow_list)
|
||||
|
||||
def test_create(self):
|
||||
sot = volume.VolumeDetail(**VOLUME_DETAIL)
|
||||
|
|
Loading…
Reference in New Issue