Merge pull request #30927 from zjcmszh/test_remove

test/pybind/rbd.pyx: add test_remove_snap_by_id case in test_rbd.py

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
This commit is contained in:
Jason Dillaman 2019-10-15 21:05:53 -04:00 committed by GitHub
commit 7eb7857a86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -762,6 +762,15 @@ class TestImage(object):
self.image.remove_snap('snap1')
eq([], list(self.image.list_snaps()))
def test_remove_snap_by_id(self):
eq([], list(self.image.list_snaps()))
self.image.create_snap('snap1')
eq(['snap1'], [snap['name'] for snap in self.image.list_snaps()])
for snap in self.image.list_snaps():
snap_id = snap["id"]
self.image.remove_snap_by_id(snap_id)
eq([], list(self.image.list_snaps()))
def test_rename_snap(self):
eq([], list(self.image.list_snaps()))
self.image.create_snap('snap1')