301
302
'rev-1_1_1_1_1_1_1 | sixth\n',
305
def test_annotate_unicode_author(self):
306
tree1 = self.make_branch_and_tree('tree1')
308
self.build_tree_contents([('tree1/a', 'adi\xc3\xb3s')])
309
tree1.add(['a'], ['a-id'])
310
tree1.commit('a', rev_id='rev-1',
311
committer=u'Pepe P\xe9rez <pperez@ejemplo.com>',
312
timestamp=1166046000.00, timezone=0)
314
self.build_tree_contents([('tree1/b', 'bye')])
315
tree1.add(['b'], ['b-id'])
316
tree1.commit('b', rev_id='rev-2',
317
committer=u'p\xe9rez',
318
timestamp=1166046000.00, timezone=0)
320
# this passes if no exception is raised
322
annotate.annotate_file(tree1.branch, 'rev-1', 'a-id', to_file=to_file)
325
to_file = codecs.getwriter('ascii')(sio)
326
to_file.encoding = 'ascii' # codecs does not set it
327
annotate.annotate_file(tree1.branch, 'rev-2', 'b-id', to_file=to_file)
328
self.assertEqualDiff('2 p?rez | bye\n', sio.getvalue())
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', to_file.getvalue())
336
# and when it does not exist
338
annotate.annotate_file(tree1.branch, 'rev-2', 'b-id', to_file=to_file)
339
self.assertContainsRe('2 p.rez | bye\n', to_file.getvalue())
305
342
class TestReannotate(tests.TestCase):