Exemplo n.º 1
0
    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)
Exemplo n.º 2
0
    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
Exemplo n.º 4
0
    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
Exemplo n.º 5
0
    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))
Exemplo n.º 6
0
    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))
Exemplo n.º 7
0
    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))
Exemplo n.º 8
0
    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
Exemplo n.º 10
0
 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