def testBOL(self): s = u'---\n b' f = HorizontalRuler(s, 0) frags, next = f.apply() self.assertEqual(u"".join(frags), u'<hr/>') self.assertEqual(next, s.index(" b"))
def testEOL(self): s = u'Over!\n---' f = HorizontalRuler(s, 0) frags, next = f.apply() self.assertEqual(u"".join(frags), u'Over!<hr/>') self.assertEqual(next, len(s))
def testBetweenManyLines(self): s = u'a\n\n----\n\nb' f = HorizontalRuler(s, 0) frags, next = f.apply() self.assertEqual(u"".join(frags), u'a\n<hr/>') self.assertEqual(next, s.index("\nb"))