def runcase(self, inserttext, stopline, expected):
        text = self.text
        text.insert('1.0', inserttext)
        for line in range(1, stopline):
            linelength = int(text.index('%d.end' % line).split('.')[1])
            for col in (0, linelength // 2, linelength):
                tempindex = '%d.%d' % (line, col)
                self.assertEqual(fp.find_paragraph(text, tempindex), expected)

        text.delete('1.0', 'end')
Beispiel #2
0
    def runcase(self, inserttext, stopline, expected):
        text = self.text
        text.insert('1.0', inserttext)
        for line in range(1, stopline):
            linelength = int(text.index('%d.end' % line).split('.')[1])
            for col in (0, linelength // 2, linelength):
                tempindex = '%d.%d' % (line, col)
                self.assertEqual(fp.find_paragraph(text, tempindex), expected)

        text.delete('1.0', 'end')
 def runcase(self, inserttext, stopline, expected):
     # Check that find_paragraph returns the expected paragraph when
     # the mark index is set to beginning, middle, end of each line
     # up to but not including the stop line
     text = self.text
     text.insert('1.0', inserttext)
     for line in range(1, stopline):
         linelength = int(text.index("%d.end" % line).split('.')[1])
         for col in (0, linelength // 2, linelength):
             tempindex = "%d.%d" % (line, col)
             self.assertEqual(fp.find_paragraph(text, tempindex), expected)
     text.delete('1.0', 'end')
 def runcase(self, inserttext, stopline, expected):
     # Check that find_paragraph returns the expected paragraph when
     # the mark index is set to beginning, middle, end of each line
     # up to but not including the stop line
     text = self.text
     text.insert('1.0', inserttext)
     for line in range(1, stopline):
         linelength = int(text.index("%d.end" % line).split('.')[1])
         for col in (0, linelength//2, linelength):
             tempindex = "%d.%d" % (line, col)
             self.assertEqual(fp.find_paragraph(text, tempindex), expected)
     text.delete('1.0', 'end')