From: weiyingze-git Date: Tue, 29 Oct 2019 19:22:26 +0000 (+0800) Subject: test:add test_remove_snap_ImageNotFound interface in remove snap part X-Git-Tag: v15.1.0~997^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d3098c82552991ef0ce7a19285a58697c8cf973a;p=ceph.git test:add test_remove_snap_ImageNotFound interface in remove snap part Signed-off-by: Yingze Wei --- diff --git a/src/pybind/rbd/rbd.pyx b/src/pybind/rbd/rbd.pyx index 76188e69463c..e168170315eb 100644 --- a/src/pybind/rbd/rbd.pyx +++ b/src/pybind/rbd/rbd.pyx @@ -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 diff --git a/src/test/pybind/test_rbd.py b/src/test/pybind/test_rbd.py index 77c0e2df353d..c941a7babc81 100644 --- a/src/test/pybind/test_rbd.py +++ b/src/test/pybind/test_rbd.py @@ -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')