~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 17:45:52 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-20070706174552-1sqmi8ij1tus410q
Improve tests a bit, actually checking for the replace encoding.

Show diffs side-by-side

added added

removed removed

Lines of Context:
317
317
                     committer=u'p\xe9rez',
318
318
                     timestamp=1166046000.00, timezone=0)
319
319
 
320
 
        # the test passes if the annotate_file() calls below do not raise an
321
 
        # exception
322
 
 
323
 
        to_file = codecs.EncodedFile(StringIO(), 'utf-8')
 
320
        # this passes if no exception is raised
 
321
        to_file = StringIO()
324
322
        annotate.annotate_file(tree1.branch, 'rev-1', 'a-id', to_file=to_file)
325
323
 
326
 
        to_file = codecs.getwriter('ascii')(StringIO())
 
324
        sio = StringIO()
 
325
        to_file = codecs.getwriter('ascii')(sio)
327
326
        to_file.encoding = 'ascii' # codecs does not set it
328
327
        annotate.annotate_file(tree1.branch, 'rev-2', 'b-id', to_file=to_file)
 
328
        self.assertEqualDiff('2   p?rez   | bye\n', sio.getvalue())
329
329
 
330
330
 
331
331
class TestReannotate(tests.TestCase):