~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/workingtree_implementations/test_set_root_id.py

  • Committer: John Arbash Meinel
  • Date: 2007-02-18 00:22:24 UTC
  • mto: This revision was merged to the branch mainline in revision 2298.
  • Revision ID: john@arbash-meinel.com-20070218002224-nfsw9ubivr178ahn
Switch all apis over to utf8 file ids. All tests pass

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
    def test_set_and_read_unicode(self):
37
37
        tree = self.make_branch_and_tree('a-tree')
38
38
        # setting the root id allows it to be read via get_root_id.
 
39
        root_id = u'\xe5n-id'.encode('utf8')
39
40
        tree.lock_write()
40
41
        try:
41
42
            old_id = tree.get_root_id()
42
 
            tree.set_root_id(u'\xe5n id')
43
 
            self.assertEqual(u'\xe5n id', tree.get_root_id())
 
43
            tree.set_root_id(root_id)
 
44
            self.assertEqual(root_id, tree.get_root_id())
44
45
            # set root id should not have triggered a flush of the tree,
45
46
            # so check a new tree sees the old state.
46
47
            reference_tree = tree.bzrdir.open_workingtree()
50
51
        # having unlocked the tree, the value should have been 
51
52
        # preserved into the next lock, which is an implicit read
52
53
        # lock around the get_root_id call.
53
 
        self.assertEqual(u'\xe5n id', tree.get_root_id())
 
54
        self.assertEqual(root_id, tree.get_root_id())
54
55
        # and if we get a new working tree instance, then the value
55
56
        # should still be retained
56
57
        tree = tree.bzrdir.open_workingtree()
57
 
        self.assertEqual(u'\xe5n id', tree.get_root_id())
 
58
        self.assertEqual(root_id, tree.get_root_id())