~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testworkingtree.py

  • Committer: Robert Collins
  • Date: 2005-10-16 21:51:55 UTC
  • mto: This revision was merged to the branch mainline in revision 1458.
  • Revision ID: robertc@lifelesslap.robertcollins.net-20051016215155-e6431a4a5f1d1fb8
rather than getting the branch inventory, WorkingTree can use the whole Branch, or make its own.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
from bzrlib.branch import Branch
20
20
from bzrlib.selftest import TestCaseInTempDir
21
21
from bzrlib.trace import mutter
22
 
from bzrlib.workingtree import TreeEntry, TreeDirectory, TreeFile, TreeLink
 
22
from bzrlib.workingtree import (TreeEntry, TreeDirectory, TreeFile, TreeLink,
 
23
                                WorkingTree)
23
24
 
24
25
class TestTreeDirectory(TestCaseInTempDir):
25
26
 
57
58
        self.assertEqual(files[0], ('dir', '?', 'directory', None, TreeDirectory()))
58
59
        self.assertEqual(files[1], ('file', '?', 'file', None, TreeFile()))
59
60
        self.assertEqual(files[2], ('symlink', '?', 'symlink', None, TreeLink()))
 
61
 
 
62
    def test_construct_with_branch(self):
 
63
        branch = Branch.initialize('.')
 
64
        tree = WorkingTree(branch.base, branch)
 
65
        self.assertEqual(branch, tree.branch)
 
66
        self.assertEqual(branch.inventory, tree._inventory)
 
67
        self.assertEqual(branch.base, tree.basedir)
 
68
    
 
69
    def test_construct_without_branch(self):
 
70
        branch = Branch.initialize('.')
 
71
        tree = WorkingTree(branch.base)
 
72
        self.assertEqual(branch.base, tree.branch.base)
 
73
        self.assertEqual(branch.inventory, tree._inventory)
 
74
        self.assertEqual(branch.base, tree.basedir)