def test_clean_li_xml0(self): dirt = "happy&go&lucky&&&go&happy" temp = ET.Element('li') temp.set("href", dirt) temp.set("embed", dirt) temp.set("text", dirt) temp.text = dirt temp_li = Li() temp_li.populate(temp) href_clean = temp_li.clean_li_xml(temp_li.href) embed_clean = temp_li.clean_li_xml(temp_li.embed) text_clean = temp_li.clean_li_xml(temp_li.text) floating_text_clean = temp_li.clean_li_xml(temp_li.floating_text) standard_clean = "happy&go&lucky&&&go&happy" self.assertEqual(href_clean, standard_clean) self.assertEqual(embed_clean, standard_clean) self.assertEqual(text_clean, standard_clean) self.assertEqual(floating_text_clean, standard_clean)
def test_clean_li_xml1(self): dirt = "randomdirtwithoutescape" temp = ET.Element('li') temp.set("href", dirt) temp.set("embed", dirt) temp.set("text", dirt) temp.text = dirt temp_li = Li() temp_li.populate(temp) href_clean = temp_li.clean_li_xml(temp_li.href) embed_clean = temp_li.clean_li_xml(temp_li.embed) text_clean = temp_li.clean_li_xml(temp_li.text) floating_text_clean = temp_li.clean_li_xml(temp_li.floating_text) standard_clean = "randomdirtwithoutescape" self.assertEqual(href_clean, standard_clean) self.assertEqual(embed_clean, standard_clean) self.assertEqual(text_clean, standard_clean) self.assertEqual(floating_text_clean, standard_clean)
def test_clean_li_xml2(self): dirt = "me&myself&i" temp = ET.Element('li') temp.set("href", dirt) temp.set("embed", dirt) temp.set("text", dirt) temp.text = dirt temp_li = Li() temp_li.populate(temp) href_clean = temp_li.clean_li_xml(temp_li.href) embed_clean = temp_li.clean_li_xml(temp_li.embed) text_clean = temp_li.clean_li_xml(temp_li.text) floating_text_clean = temp_li.clean_li_xml(temp_li.floating_text) standard_clean = "me&myself&i" self.assertEqual(href_clean, standard_clean) self.assertEqual(embed_clean, standard_clean) self.assertEqual(text_clean, standard_clean) self.assertEqual(floating_text_clean, standard_clean)