xmlbuilder: Make clear() remove unknown XML properties

This commit is contained in:
Cole Robinson
2014-01-25 14:57:10 -05:00
parent 16c8c31cbd
commit 9f5a842a3a
4 changed files with 49 additions and 0 deletions

View File

@@ -1104,6 +1104,16 @@ class XMLParseTest(unittest.TestCase):
# Misc tests #
##############
def testCPUUnknownClear(self):
# Make sure .clear() even removes XML elements we don't know about
basename = "clear-cpu-unknown-vals"
infile = "tests/xmlparse-xml/%s-in.xml" % basename
outfile = "tests/xmlparse-xml/%s-out.xml" % basename
guest = virtinst.Guest(conn, parsexml=file(infile).read())
guest.cpu.clear()
utils.diff_compare(guest.get_xml_config(), outfile)
def testzzzzCheckProps(self):
# pylint: disable=W0212
# Access to protected member, needed to unittest stuff