/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_dirstate.py

  • Committer: John Arbash Meinel
  • Date: 2008-06-05 21:19:11 UTC
  • mto: This revision was merged to the branch mainline in revision 3486.
  • Revision ID: john@arbash-meinel.com-20080605211911-2xtal2ehwcqkcymy
Assert that we properly encode inv_entry.symlink_target, (bug #135320)

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
from bzrlib import (
24
24
    dirstate,
25
25
    errors,
 
26
    inventory,
26
27
    osutils,
27
28
    )
28
29
from bzrlib.memorytree import MemoryTree
2514
2515
        state._discard_merge_parents()
2515
2516
        state._validate()
2516
2517
        self.assertEqual(exp_dirblocks, state._dirblocks)
 
2518
 
 
2519
 
 
2520
class Test_InvEntryToDetails(TestCaseWithDirState):
 
2521
 
 
2522
    def assertDetails(self, expected, inv_entry):
 
2523
        details = dirstate.DirState._inv_entry_to_details(inv_entry)
 
2524
        self.assertEqual(expected, details)
 
2525
 
 
2526
    def test_unicode_symlink(self):
 
2527
        uni_link_target = u'Non-\xe5scii'
 
2528
        utf8_link_target = 'Non-\xc3\xa5scii'
 
2529
        self.assertEqual(utf8_link_target, uni_link_target.encode('UTF-8'))
 
2530
        inv_entry = inventory.InventoryLink('link-file-id', 'name',
 
2531
                                            'link-parent-id')
 
2532
        inv_entry.revision = 'link-revision-id'
 
2533
        inv_entry.symlink_target = uni_link_target
 
2534
        self.assertDetails(('l', utf8_link_target, 0, False,
 
2535
                           'link-revision-id'), inv_entry)