File size: 759 Bytes
94a47f5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""
Module to test some previously found bugs in the convert.py file.
"""

from unittest import TestCase


from convert import _clean_html


class TestConvert(TestCase):
    """
    Class to test the convert.py file.
    """

    def test_clean_description(self):
        """
        Test some weird description which contains a "null" value after parsed,
        which causes problem when parsed by a CSV parser.
        """
        description = 'null\n<div class=\'nifad\'><a href="http://www.pheedo.com/click.phdo?x=a8a276f7a37a42499f8b1c69f9acf191&u=182589199"><img src="http://www.pheedo.com/img.phdo?x=a8a276f7a37a42499f8b1c69f9acf191&u=182589199" border="0"/></a></div>'
        parsed = _clean_html(description)

        self.assertEqual(parsed, "")