]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test: ceph-disk: coverage list_format_dev_plain() new behavior. 6410/head
authorVicente Cheng <freeze.bilsted@gmail.com>
Thu, 29 Oct 2015 00:27:35 +0000 (08:27 +0800)
committerVicente Cheng <freeze.bilsted@gmail.com>
Thu, 29 Oct 2015 00:27:35 +0000 (08:27 +0800)
    modify the unittest to coverage the list_format_dev_plain()
    new behavior.

Signed-off-by: Vicente Cheng <freeze.bilsted@gmail.com>
src/test/python/ceph-disk/tests/test_ceph_disk.py

index a150dd324104000c67ded688a6995fba5bffff1e..ee0003c4a78d4867c9776b5a980983ca97964aad 100644 (file)
@@ -136,7 +136,11 @@ class TestCephDisk(object):
                     'ptype': ptype,
                     'state': 'prepared',
                 }
-                out = ceph_disk.list_format_dev_plain(dev, devices)
+                with patch.multiple(
+                        ceph_disk,
+                        list_devices=lambda path: devices,
+                        ):
+                    out = ceph_disk.list_format_dev_plain(dev, devices)
                 assert 'data' in out
                 assert 'dmcrypt' in out
                 assert type in out