def test_lookup_by_uuid_string(self): with conttestlib.fake_runtime_domain() as dom: doms.add(dom) conn = Connection() guid = dom.UUIDString() dom2 = conn.lookupByUUIDString(guid) self.assertEqual(dom2.UUIDString(), guid)
def test_list_domains_id_none(self): conn = Connection() self.assertEqual(conn.listDomainsID(), [])
def test_list_all_domains_none(self): conn = Connection() self.assertEqual(conn.listAllDomains(0), [])
def test_lookup_by_id_missing(self): conn = Connection() self.assertRaises(libvirt.libvirtError, conn.lookupByID, 42)
def test_lookup_by_name_missing(self): conn = Connection() self.assertRaises(libvirt.libvirtError, conn.lookupByName, "foobar")
def test_get_lib_version(self): conn = Connection() ver = conn.getLibVersion() self.assertGreater(ver, 0)