~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_memorytree.py

  • Committer: John Arbash Meinel
  • Date: 2007-11-13 16:42:56 UTC
  • mto: This revision was merged to the branch mainline in revision 2982.
  • Revision ID: john@arbash-meinel.com-20071113164256-yvnccvwwwpkxgef0
MemoryTree is not tested under the tree_implementations tests.
So we need a specific test to make sure that it is properly handling
the Tree.get_root_id() interface.

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
            tree.get_file(tree.path2id('foo')).read())
53
53
        tree.unlock()
54
54
 
 
55
    def test_get_root_id(self):
 
56
        branch = self.make_branch('branch')
 
57
        tree = MemoryTree.create_on_branch(branch)
 
58
        tree.lock_write()
 
59
        try:
 
60
            tree.add([''])
 
61
            self.assertIsNot(None, tree.get_root_id())
 
62
        finally:
 
63
            tree.unlock()
 
64
 
55
65
    def test_lock_tree_write(self):
56
66
        """Check we can lock_tree_write and unlock MemoryTrees."""
57
67
        branch = self.make_branch('branch')