]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test:add test_remove_snap_ImageNotFound interface in remove snap part
authorweiyingze-git <weiyingze@cmss.chinamobile.com>
Tue, 29 Oct 2019 19:22:26 +0000 (03:22 +0800)
committerweiyingze-git <weiyingze@cmss.chinamobile.com>
Wed, 30 Oct 2019 13:43:34 +0000 (21:43 +0800)
Signed-off-by: Yingze Wei <weiyingze@cmss.chinamobile.com>
src/pybind/rbd/rbd.pyx
src/test/pybind/test_rbd.py

index 76188e69463c439b21d68e47cf9de597bbf3bbb8..e168170315eb13bdaf6515693beabc68d6a43cab 100644 (file)
@@ -3696,7 +3696,7 @@ cdef class Image(object):
 
         :param name: the name of the snapshot
         :type name: str
-        :raises: :class:`IOError`, :class:`ImageBusy`
+        :raises: :class:`IOError`, :class:`ImageBusy`, :class:`ImageNotFound`
         """
         name = cstr(name, 'name')
         cdef char *_name = name
index 77c0e2df353d710b67b0af386fe92bbaa438b6e7..c941a7babc81e7ba07c18c1f6a54be468ca3fb71 100644 (file)
@@ -762,6 +762,9 @@ class TestImage(object):
         self.image.remove_snap('snap1')
         eq([], list(self.image.list_snaps()))
 
+    def test_remove_snap_not_found(self):
+        assert_raises(ImageNotFound, self.image.remove_snap, 'snap1')
+
     def test_remove_snap_by_id(self):
        eq([], list(self.image.list_snaps()))
        self.image.create_snap('snap1')