~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_workingtree.py

  • Committer: John Arbash Meinel
  • Date: 2008-10-30 00:55:00 UTC
  • mto: (3815.2.5 prepare-1.9)
  • mto: This revision was merged to the branch mainline in revision 3811.
  • Revision ID: john@arbash-meinel.com-20081030005500-r5cej1cxflqhs3io
Switch so that we are using a simple timestamp as the first action.

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
            workingtree.WorkingTreeFormat.set_default_format(old_format)
82
82
        self.assertEqual(old_format, workingtree.WorkingTreeFormat.get_default_format())
83
83
 
 
84
    def test_open(self):
 
85
        tree = self.make_branch_and_tree('.')
 
86
        open_direct = workingtree.WorkingTree.open('.')
 
87
        self.assertEqual(tree.basedir, open_direct.basedir)
 
88
        open_no_args = workingtree.WorkingTree.open()
 
89
        self.assertEqual(tree.basedir, open_no_args.basedir)
 
90
 
 
91
    def test_open_containing(self):
 
92
        tree = self.make_branch_and_tree('.')
 
93
        open_direct, relpath = workingtree.WorkingTree.open_containing('.')
 
94
        self.assertEqual(tree.basedir, open_direct.basedir)
 
95
        self.assertEqual('', relpath)
 
96
        open_no_args, relpath = workingtree.WorkingTree.open_containing()
 
97
        self.assertEqual(tree.basedir, open_no_args.basedir)
 
98
        self.assertEqual('', relpath)
 
99
        open_subdir, relpath = workingtree.WorkingTree.open_containing('subdir')
 
100
        self.assertEqual(tree.basedir, open_subdir.basedir)
 
101
        self.assertEqual('subdir', relpath)
 
102
 
84
103
 
85
104
class SampleTreeFormat(workingtree.WorkingTreeFormat):
86
105
    """A sample format