def testGetVDSMDomainsWithChannel(self, arch): with MonkeyPatchScope([(libvirtconnection, 'get', lambda: FakeConnection(arch, 'chan')), (cpuarch, 'effective', lambda: arch)]): self.assertEqual([(v.UUIDString(), external,) for v, xml, external in recovery._list_domains()], self._getAllDomainIds(arch))
def testGetVDSMDomainsWithoutGuestfs(self, arch): connect = lambda: FakeConnection(arch, 'org.libguestfs.channel.0') with MonkeyPatchScope([(libvirtconnection, 'get', connect), (cpuarch, 'effective', lambda: arch)]): self.assertEqual(recovery._list_domains(), [])