Merge "Avoid using whitespace in test_safe_parse_xml."
This commit is contained in:
commit
11a949c148
@ -428,13 +428,8 @@ class GenericUtilsTestCase(test.TestCase):
|
||||
|
||||
def test_safe_parse_xml(self):
|
||||
|
||||
normal_body = ("""
|
||||
<?xml version="1.0" ?><foo>
|
||||
<bar>
|
||||
<v1>hey</v1>
|
||||
<v2>there</v2>
|
||||
</bar>
|
||||
</foo>""").strip()
|
||||
normal_body = ('<?xml version="1.0" ?>'
|
||||
'<foo><bar><v1>hey</v1><v2>there</v2></bar></foo>')
|
||||
|
||||
def killer_body():
|
||||
return (("""<!DOCTYPE x [
|
||||
@ -453,7 +448,9 @@ class GenericUtilsTestCase(test.TestCase):
|
||||
}).strip()
|
||||
|
||||
dom = utils.safe_minidom_parse_string(normal_body)
|
||||
self.assertEqual(normal_body, str(dom.toxml()))
|
||||
# Some versions of minidom inject extra newlines so we ignore them
|
||||
result = str(dom.toxml()).replace('\n', '')
|
||||
self.assertEqual(normal_body, result)
|
||||
|
||||
self.assertRaises(ValueError,
|
||||
utils.safe_minidom_parse_string,
|
||||
|
Loading…
x
Reference in New Issue
Block a user