From 22974178ad24767812a30aff1157f829a9a43f7d Mon Sep 17 00:00:00 2001 From: Gangbiao Liu Date: Wed, 23 Oct 2019 10:26:02 +0800 Subject: [PATCH] test/pybind: add create_snap rasie ImageExists test case Signed-off-by: Gangbiao Liu --- src/test/pybind/test_rbd.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/test/pybind/test_rbd.py b/src/test/pybind/test_rbd.py index 77c0e2df353..2795d901334 100644 --- a/src/test/pybind/test_rbd.py +++ b/src/test/pybind/test_rbd.py @@ -741,6 +741,11 @@ class TestImage(object): eq(snap_data, b'\0' * 256) self.image.remove_snap('snap1') + def test_create_snap_exists(self): + self.image.create_snap('snap1') + assert_raises(ImageExists, self.image.create_snap, 'snap1') + self.image.remove_snap('snap1') + def test_list_snaps(self): eq([], list(self.image.list_snaps())) self.image.create_snap('snap1') -- 2.39.5