Ejemplo n.º 1
0
 def test_text_between_not_found(self):
     expected = self.s
     result = Utils.text_between(self.s, '<h1>', '</h1>')
     result_force_html = Utils.text_between(self.s, '<h1', '/h1', True)
     self.assertEqual(expected, result)
     self.assertEqual(expected, result_force_html)
Ejemplo n.º 2
0
 def test_remove_spaces(self):
     text = 'Something  else\nand another thing  '
     expected = 'Something else and another thing'
     result = Utils.remove_spaces(text)
     self.assertEqual(expected, result)
Ejemplo n.º 3
0
 def test_text_after_not_found(self):
     expected = self.s
     result = Utils.text_after(self.s, '<h1>')
     self.assertEqual(expected, result)
Ejemplo n.º 4
0
 def test_text_between(self):
     expected = 'Something'
     result = Utils.text_between(self.s, '<a href="#">', '</a>')
     result_force_html = Utils.text_between(self.s, '<a', '/a', True)
     self.assertEqual(expected, result)
     self.assertEqual(expected, result_force_html)
Ejemplo n.º 5
0
 def test_text_before_not_found(self):
     expected = self.s
     result = Utils.text_before(self.s, '</br>')
     self.assertEqual(expected, result)
Ejemplo n.º 6
0
 def test_text_after(self):
     expected = 'Something</a>'
     result = Utils.text_after(self.s, '<a href="#">')
     self.assertEqual(expected, result)
Ejemplo n.º 7
0
 def test_remove_tags(self):
     expected = 'Something'
     result = Utils.remove_tags(self.s)
     self.assertEqual(expected, result)
Ejemplo n.º 8
0
 def test_text_before(self):
     expected = '<a href="#">Something'
     result = Utils.text_before(self.s, '</a>')
     self.assertEqual(expected, result)
Ejemplo n.º 9
0
 def test_remove_accents(self):
     text = 'trava-língua'
     expected = 'trava-lingua'
     result = Utils.remove_accents(text)
     self.assertEqual(expected, result)
Ejemplo n.º 10
0
 def test_split_html_tag(self):
     html = 'Something<br>else<br />and<br/>another<br></br>thing'
     expected = ['Something', 'else', 'and', 'another', 'thing']
     result = Utils.split_html_tag(html, 'br')
     self.assertListEqual(expected, result)
Ejemplo n.º 11
0
 def test_remove_spaces(self):
     text = 'Something  else\nand another thing  '
     expected = 'Something else and another thing'
     result = Utils.remove_spaces(text)
     self.assertEqual(expected, result)
Ejemplo n.º 12
0
 def test_text_between(self):
     expected = 'Something'
     result = Utils.text_between(self.s, '<a href="#">', '</a>')
     result_force_html = Utils.text_between(self.s, '<a', '/a', True)
     self.assertEqual(expected, result)
     self.assertEqual(expected, result_force_html)
Ejemplo n.º 13
0
 def test_text_after(self):
     expected = 'Something</a>'
     result = Utils.text_after(self.s, '<a href="#">')
     self.assertEqual(expected, result)
Ejemplo n.º 14
0
 def test_remove_accents(self):
     text = 'trava-língua'
     expected = 'trava-lingua'
     result = Utils.remove_accents(text)
     self.assertEqual(expected, result)
Ejemplo n.º 15
0
 def test_text_before(self):
     expected = '<a href="#">Something'
     result = Utils.text_before(self.s, '</a>')
     self.assertEqual(expected, result)
Ejemplo n.º 16
0
 def test_split_html_tag(self):
     html = 'Something<br>else<br />and<br/>another<br></br>thing'
     expected = ['Something', 'else', 'and', 'another', 'thing']
     result = Utils.split_html_tag(html, 'br')
     self.assertListEqual(expected, result)
Ejemplo n.º 17
0
 def test_remove_tags(self):
     expected = 'Something'
     result = Utils.remove_tags(self.s)
     self.assertEqual(expected, result)