def test_fill(self): tools.eq_(display.fill(self.u_paragraph), '\n'.join(self.u_paragraph_out)) tools.eq_(display.fill(self.utf8_paragraph), '\n'.join(self.u_paragraph_out)) tools.eq_(display.fill(self.u_mixed_para), '\n'.join(self.u_mixed_para_out)) tools.eq_(display.fill(self.u_mixed_para, width=57, initial_indent=' ', subsequent_indent='----'), '\n'.join(self.u_mixed_para_57_initial_subsequent_out))
def test_fill(self): tools.eq_(display.fill(self.u_paragraph), u'\n'.join(self.u_paragraph_out)) tools.eq_(display.fill(self.utf8_paragraph), u'\n'.join(self.u_paragraph_out)) tools.eq_(display.fill(self.u_mixed_para), u'\n'.join(self.u_mixed_para_out)) tools.eq_(display.fill(self.u_mixed_para, width=57, initial_indent=' ', subsequent_indent='----'), u'\n'.join(self.u_mixed_para_57_initial_subsequent_out))
def utf8_text_fill(text, *args, **kwargs): '''**Deprecated** Use :func:`kitchen.text.display.fill` instead.''' warnings.warn(_('kitchen.text.utf8.utf8_text_fill is deprecated. Use' ' kitchen.text.display.fill instead'), DeprecationWarning, stacklevel=2) # This assumes that all args. are utf8. return fill(text, *args, **kwargs)
def utf8_text_fill(text, *args, **kwargs): '''**Deprecated** Similar to :func:`textwrap.fill` but understands :term:`utf-8` strings and doesn't screw up lists/blocks/etc. Use :func:`kitchen.text.display.fill` instead. ''' warnings.warn('kitchen.text.utf8.utf8_text_fill is deprecated. Use' ' kitchen.text.display.fill instead', DeprecationWarning, stacklevel=2) # This assumes that all args. are utf8. return fill(text, *args, **kwargs)