def test_clean_up_xml(self): # Make sure the whitespace at the end of a self-closing tag is removed. bad_xml = ''' <root> <selfclosingtag /> </root>''' good_xml = ''' <root> <selfclosingtag/> </root>''' self.assertEqual(clean_up_xml(bad_xml), good_xml) self.assertEqual(clean_up_xml(good_xml), good_xml)
def test_clean_up_xml_encoding(self): # Make sure the right encoding is added. self.assertEqual( clean_up_xml('<?xml version="1.0"?>'), '<?xml version="1.0" encoding="UTF-8"?>' )