def test_li_populate0(self): temp = ET.Element('li') temp.set("href", "href_stuff") temp.text = "randomfloatingtext" temp_li = Li() temp_li.populate(temp) self.assertEqual(temp_li.href, "href_stuff") self.assertEqual(temp_li.floating_text, "randomfloatingtext")
def test_li_print_xml2(self): temp = ET.Element('li') temp.set("href", "fee") temp.set("embed", "foo") temp.set("text", "fi") temp.text = "fum" temp_li = Li() temp_li.populate(temp) temp_string = temp_li.print_xml() correct_string = "<li> href=\"fee\"</li><li> embed=\"foo\"</li><li>fi</li><li>fum</li>" self.assertEqual(temp_string, correct_string)
def test_li_print_xml1(self): temp = ET.Element('li') temp.set("href", "HELLO") temp.set("embed", "EMBED") temp.set("text", "TEXT") temp.text = "RANDOMTEXT" temp_li = Li() temp_li.populate(temp) temp_string = temp_li.print_xml() correct_string = "<li> href=\"HELLO\"</li><li> embed=\"EMBED\"</li><li>TEXT</li><li>RANDOMTEXT</li>" self.assertEqual(temp_string, correct_string)
def test_li_print_xml0(self): temp = ET.Element('li') temp.set("href", "href_stuff") temp.set("embed", "embed_stuff") temp.set("text", "text_stuff") temp.text = "randomfloatingtext" temp_li = Li() temp_li.populate(temp) temp_string = temp_li.print_xml() correct_string = "<li> href=\"href_stuff\"</li><li> embed=\"embed_stuff\"</li><li>text_stuff</li><li>randomfloatingtext</li>" self.assertEqual(temp_string, correct_string)
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_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_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)
def test_li_populate2(self): temp = ET.Element('li') temp.text = "randomfloatingtext" temp_li = Li() temp_li.populate(temp) self.assertEqual(temp_li.floating_text, "randomfloatingtext")