Exemplo n.º 1
0
 def test_set_line_nums_around_action_word(self):
     result_page = WebPage()
     result_page.lines = ['aa', 'bbbb', 'ccccc', 'ddddd', 'aaaaa', 'eeeee']
     result_page.set_line_nums_with_word('a')
     result_page.set_line_nums_around_action_word()
     self.assertEqual(result_page.line_nums_around_action_word,
                      set([0, 1, 3, 4, 5]))
Exemplo n.º 2
0
 def test_set_clusters_around_action_word(self):
     result_page = WebPage()
     result_page.lines = [
         'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l'
     ]
     result_page.line_nums_around_action_word = set([0, 1, 3, 4, 5, 9, 10])
     result_page.set_line_clusters_around_action_word()
     self.assertEqual(result_page.line_clusters_around_action_word,
                      [['a', 'b'], ['d', 'e', 'f'], ['j', 'k']])
Exemplo n.º 3
0
 def test_set_line_nums_around_action_word(self):
     result_page = WebPage()
     result_page.lines = ['aa', 'bbbb', 'ccccc', 'ddddd', 'aaaaa', 'eeeee']
     result_page.set_line_nums_with_word('a')
     result_page.set_line_nums_around_action_word()
     self.assertEqual(result_page.line_nums_around_action_word, set([0, 1, 3, 4, 5]))
Exemplo n.º 4
0
 def test_set_line_nums_with_word(self):
     result_page = WebPage()
     result_page.lines = ['abc', 'bcd', 'cde']
     result_page.set_line_nums_with_word('b')
     self.assertEqual(result_page.line_nums_with_action_word, set([0, 1]))
Exemplo n.º 5
0
 def test_set_clusters_around_action_word(self):
     result_page = WebPage()
     result_page.lines = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l']
     result_page.line_nums_around_action_word = set([0, 1, 3, 4, 5, 9, 10])
     result_page.set_line_clusters_around_action_word()
     self.assertEqual(result_page.line_clusters_around_action_word, [['a', 'b'], ['d', 'e', 'f'], ['j', 'k']])
Exemplo n.º 6
0
 def test_set_line_nums_with_word(self):
     result_page = WebPage()
     result_page.lines = ['abc', 'bcd', 'cde']
     result_page.set_line_nums_with_word('b')
     self.assertEqual(result_page.line_nums_with_action_word, set([0, 1]))