/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_rio.py

  • Committer: Aaron Bentley
  • Date: 2007-03-02 16:00:33 UTC
  • mto: (2323.6.9 0.15-integration)
  • mto: This revision was merged to the branch mainline in revision 2330.
  • Revision ID: abentley@panoramicfeedback.com-20070302160033-24rk2wsej7212y0f
Fix handling of whitespace-stripping without newline munging

Show diffs side-by-side

added added

removed removed

Lines of Context:
355
355
        new_child = rio.read_stanza_unicode(child_text.splitlines(True))
356
356
        self.assertEqual(uni_data, new_child.get('foo'))
357
357
 
358
 
    def mail_munge(self, lines):
 
358
    def mail_munge(self, lines, dos_nl=True):
359
359
        new_lines = []
360
360
        for line in lines:
361
 
            line = re.sub('([^\r])\n', '\\1\r\n', line)
362
 
            line = re.sub(' *\r\n', '\r\n', line)
 
361
            line = re.sub(' *\n', '\n', line)
 
362
            if dos_nl:
 
363
                line = re.sub('([^\r])\n', '\\1\r\n', line)
363
364
            new_lines.append(line)
364
365
        return new_lines
365
366
 
371
372
            self.assertTrue(72 >= len(line))
372
373
        for line in rio.to_patch_lines(stanza, max_width=12):
373
374
            self.assertTrue(12 >= len(line))
 
375
        new_stanza = rio.read_patch_stanza(self.mail_munge(lines,
 
376
                                                           dos_nl=False))
374
377
        lines = self.mail_munge(lines)
375
378
        new_stanza = rio.read_patch_stanza(lines)
376
379
        self.assertEqual('#\n\r\\r ', new_stanza.get('data'))