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]))
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']])
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]))
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']])