예제 #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]))
예제 #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']])
예제 #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]))
예제 #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]))
예제 #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']])
예제 #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]))