def test_unicode_character(self): """ Verify a unicode character does not cause the html_to_text method to throw an error """ unicode_string = u'\u0420\u0024' ml_stripper.html_to_text(unicode_string)
def parsePlot(self, item): plot = '' description = item.find('description') if description != None: # strip html from string plot = ml_stripper.html_to_text(description.string) return plot
def test_no_tags_to_strip(self): """ Verify content without html tags do not throw expection """ expected_string = 'no html tags here' paragraph_string = expected_string self.assertEquals(expected_string, ml_stripper.html_to_text(paragraph_string))
def test_strip_paragraph_tag(self): """ Verify <p> tags are removed from a string """ expected_string = 'test description here' paragraph_string = '<p>' + expected_string + '</p>' self.assertEquals(expected_string, ml_stripper.html_to_text(paragraph_string))
def parsePlotOutline(self, item): plot_outline = '' summary = item.find('itunes:summary') if summary != None: plot_outline = ml_stripper.html_to_text(summary.string) return plot_outline