def test_raw(self): formatter = shell.SmartFormatter(None) raw_string = 'R|sample text blah this is a long piece of '\ 'text that should be split over lines but wont be because its raw'\ ' text blah!!! and will split over new lines\nthis should be a '\ 'on a new line' value = formatter._split_lines(raw_string, self.width) self.assertEqual(value, raw_string[2:].splitlines())
def test_normal(self): formatter = shell.SmartFormatter(None) raw_string = 'This is a raw string that will be split over lines '\ 'because it will go into the HelpFormatter. but This string '\ 'needs to be longer'\ 'than 80 chars to split on the lines' value = formatter._split_lines(raw_string, self.width) self.assertEqual( value, HelpFormatter._split_lines(formatter, raw_string, self.width))