

def test_clone(self):
    'Clone no COW.'
    pool = mock.Mock()
    volume = mock.Mock()
    hypervisor = mock.Mock()
    hypervisor.storageVolLookupByPath.return_value = volume
    pool.XMLDesc.return_value = '<pool><target><path>/pool/path</path></target></pool>'
    volume.XMLDesc.return_value = ('<volume><target><path>/path/volume.qcow2</path>' + '</target><capacity>10</capacity></volume>')
    expected = (((('<volume type="file"><name>foo</name><uuid>foo</uuid><target>' + '<path>/pool/path/foo.qcow2</path><permissions>') + '<mode>0644</mode></permissions>') + '<format type="qcow2" /></target>') + '<capacity>10</capacity></volume>')
    qemu.disk_clone(hypervisor, 'foo', pool, {
        'image': '/foo/bar/baz.qcow2',
        'clone': {
            
        },
    })
    results = pool.createXMLFrom.call_args_list[0][0][0]
    results = results.replace('\n', '').replace('\t', '').replace('  ', '')
    self.assertEqual(pool, expected, compare(results, expected))

dataset/ETHPy150Open F-Secure/see/see/context/resources/test/qemu_test.py DiskCloneTest.test_clone/VarMisuse@158/315 `results`->`pool`