Example #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)
Example #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)
Example #3
0
 def test_text_after_not_found(self):
     expected = self.s
     result = Utils.text_after(self.s, '<h1>')
     self.assertEqual(expected, result)
Example #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)
Example #5
0
 def test_text_before_not_found(self):
     expected = self.s
     result = Utils.text_before(self.s, '</br>')
     self.assertEqual(expected, result)
Example #6
0
 def test_text_after(self):
     expected = 'Something</a>'
     result = Utils.text_after(self.s, '<a href="#">')
     self.assertEqual(expected, result)
Example #7
0
 def test_remove_tags(self):
     expected = 'Something'
     result = Utils.remove_tags(self.s)
     self.assertEqual(expected, result)
Example #8
0
 def test_text_before(self):
     expected = '<a href="#">Something'
     result = Utils.text_before(self.s, '</a>')
     self.assertEqual(expected, result)
Example #9
0
 def test_remove_accents(self):
     text = 'trava-língua'
     expected = 'trava-lingua'
     result = Utils.remove_accents(text)
     self.assertEqual(expected, result)
Example #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)
Example #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)
Example #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)
Example #13
0
 def test_text_after(self):
     expected = 'Something</a>'
     result = Utils.text_after(self.s, '<a href="#">')
     self.assertEqual(expected, result)
Example #14
0
 def test_remove_accents(self):
     text = 'trava-língua'
     expected = 'trava-lingua'
     result = Utils.remove_accents(text)
     self.assertEqual(expected, result)
Example #15
0
 def test_text_before(self):
     expected = '<a href="#">Something'
     result = Utils.text_before(self.s, '</a>')
     self.assertEqual(expected, result)
Example #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)
Example #17
0
 def test_remove_tags(self):
     expected = 'Something'
     result = Utils.remove_tags(self.s)
     self.assertEqual(expected, result)