

def setUp(self):
    self.libvirt_vol_up_mock = self.patch('libvirt.virStorageVol.upload')
    self.libvirt_stream_snd_mock = self.patch('libvirt.virStream.sendAll')
    self.libvirt_stream_fin_mock = self.patch('libvirt.virStream.finish')
    self._libvirt_clear_all()
    conn = LibvirtManager.get_connection('test:///default')
    self.caps_patcher = mock.patch.object(conn, 'getCapabilities')
    self.caps_mock = self.caps_patcher.start()
    self.addCleanup(self.caps_patcher.stop)
    self.caps_mock.return_value = CAPS_XML

dataset/ETHPy150Open openstack/fuel-devops/devops/tests/driver/libvirt/base.py LibvirtTestCase.setUp/original