~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_whitebox.py

Merge from integration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
from bzrlib.tests import TestCaseInTempDir, TestCase
5
5
from bzrlib.branch import ScratchBranch, Branch
6
 
from bzrlib.errors import NotBranchError
 
6
from bzrlib.errors import PathNotChild
7
7
 
8
8
 
9
9
class TestBranch(TestCaseInTempDir):
11
11
    def test_no_changes(self):
12
12
        from bzrlib.errors import PointlessCommit
13
13
        
14
 
        b = Branch.initialize('.')
 
14
        b = Branch.initialize(u'.')
15
15
 
16
16
        self.build_tree(['hello.txt'])
17
17
 
41
41
 
42
42
    def test_rename_dirs(self):
43
43
        """Test renaming directories and the files within them."""
44
 
        b = Branch.initialize('.')
 
44
        b = Branch.initialize(u'.')
45
45
        self.build_tree(['dir/', 'dir/sub/', 'dir/sub/file'])
46
46
        b.working_tree().add(['dir', 'dir/sub', 'dir/sub/file'])
47
47
 
94
94
            # root = nothing
95
95
            self.assertEqual(rp(dtmp), '')
96
96
 
97
 
            self.assertRaises(NotBranchError,
 
97
            self.assertRaises(PathNotChild,
98
98
                              rp,
99
99
                              '/etc')
100
100
 
101
101
            # now some near-miss operations -- note that
102
102
            # os.path.commonprefix gets these wrong!
103
 
            self.assertRaises(NotBranchError,
 
103
            self.assertRaises(PathNotChild,
104
104
                              rp,
105
105
                              dtmp.rstrip('\\/') + '2')
106
106
 
107
 
            self.assertRaises(NotBranchError,
 
107
            self.assertRaises(PathNotChild,
108
108
                              rp,
109
109
                              dtmp.rstrip('\\/') + '2/foo')
110
110
 
121
121
 
122
122
            self.assertEqual(rp(os.path.abspath('foo')), 'foo')
123
123
 
124
 
            self.assertRaises(NotBranchError,
 
124
            self.assertRaises(PathNotChild,
125
125
                              rp, '../foo')
126
126
 
127
127
        finally: