def test_findLiveSnapshotSupport(self): capsFile = self._readCaps("caps_libvirt_intel_i73770_nosnap.out") capsData = ET.fromstring(capsFile) guests = capsData.findall('guest') result = caps._findLiveSnapshotSupport(guests[0]) self.assertIsNone(result) result = caps._findLiveSnapshotSupport(guests[1]) self.assertFalse(result) capsFile = self._readCaps("caps_libvirt_intel_i73770.out") capsData = ET.fromstring(capsFile) guests = capsData.findall('guest') result = caps._findLiveSnapshotSupport(guests[0]) self.assertIsNone(result) result = caps._findLiveSnapshotSupport(guests[1]) self.assertTrue(result)
def test_findLiveSnapshotSupport_badData(self): # XML which completely does not fit the schema expected caps_string = "<a><b></b></a>" caps_data = ET.fromstring(caps_string) result = caps._findLiveSnapshotSupport(caps_data) self.assertIsNone(result)