~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_inv.py

Fix encoding of 'already versioned' error

Show diffs side-by-side

added added

removed removed

Lines of Context:
354
354
        inv = Inventory('tree-root-123')
355
355
        inv.add(TreeReference('nested-id', 'nested', parent_id='tree-root-123',
356
356
                              revision='rev', reference_revision='rev2'))
 
357
 
 
358
 
 
359
class TestEncoding(TestCase):
 
360
 
 
361
    def test_error_encoding(self):
 
362
        inv = Inventory('tree-root')
 
363
        inv.add(InventoryFile('a-id', u'\u1234', 'tree-root'))
 
364
        try:
 
365
            inv.add(InventoryFile('b-id', u'\u1234', 'tree-root'))
 
366
        except errors.BzrError, e:
 
367
            self.assertContainsRe(str(e), u'\u1234'.encode('utf-8'))