@testutils.patch_object(bdev.LogicalVolume, "Attach")
  def testLogicalVolumeExport(self, attach_mock):
    """Test for bdev.LogicalVolume.Export()"""
    # Set up the mock object return value
    attach_mock.return_value = True

    # Create a fake logical volume
    test_unique_id = ("ganeti",  "31225655-5775-4356-c212-e8b1e137550a.disk0")
    inst = bdev.LogicalVolume(test_unique_id, [], 1024, {}, {})

    # Desired output command
    export_cmd = [constants.DD_CMD,
                  "if=%s" % inst.dev_path,
                  "bs=%s" % constants.DD_BLOCK_SIZE,
                  "count=%s" % inst.size,
                  "iflag=direct"]

    self.assertEqual(inst.Export(), export_cmd)
dataset/ETHPy150Open ganeti/ganeti/test/py/ganeti.storage.bdev_unittest.py/TestLogicalVolume.testLogicalVolumeExport/original