~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_annotate.py

  • Committer: Adeodato Simó
  • Date: 2007-07-06 20:24:43 UTC
  • mto: (2593.2.1 ianc-integration)
  • mto: This revision was merged to the branch mainline in revision 2594.
  • Revision ID: dato@net.com.org.es-20070706202443-1y35w9kw5g23yz8a
Cope with to_file.encoding being None or not present.

Show diffs side-by-side

added added

removed removed

Lines of Context:
327
327
        annotate.annotate_file(tree1.branch, 'rev-2', 'b-id', to_file=to_file)
328
328
        self.assertEqualDiff('2   p?rez   | bye\n', sio.getvalue())
329
329
 
 
330
        # test now with to_file.encoding = None
 
331
        to_file = tests.StringIOWrapper()
 
332
        to_file.encoding = None
 
333
        annotate.annotate_file(tree1.branch, 'rev-2', 'b-id', to_file=to_file)
 
334
        self.assertContainsRe('2   p.rez   | bye\n', sio.getvalue())
 
335
 
 
336
        # and when it does not exist
 
337
        to_file = StringIO()
 
338
        annotate.annotate_file(tree1.branch, 'rev-2', 'b-id', to_file=to_file)
 
339
        self.assertContainsRe('2   p.rez   | bye\n', sio.getvalue())
 
340
 
330
341
 
331
342
class TestReannotate(tests.TestCase):
332
343