Exemplo n.º 1
0
    def assertPoint(self, text, index, point, reverse=True):
        """
        Assert that the given index within the given text produces the
        expected point
        """
        citer = Citer()
        actual = citer.indexToPoint(text, index)
        self.assertEqual(point, unicode(actual),
            u"Expected index {index} to"
            u" be at point {point} but it was {actual}"
            u"\n\n{text!r}".format(**locals()).encode('utf-8'))

        if reverse:
            # assert the reverse
            self.assertIndex(text, point, index)