124
124
self.addCleanup(tree.unlock)
125
125
self.assertEqual(set([]), tree.paths2ids(['file'],
126
126
require_versioned=False))
128
def test_canonical_path(self):
129
work_tree = self.make_branch_and_tree('tree')
130
self.build_tree(['tree/dir/', 'tree/dir/file'])
131
work_tree.add(['dir', 'dir/file'])
132
work_tree.commit('commit 1')
133
self.assertEqual(work_tree.get_canonical_path('Dir/File'), 'dir/file')
135
def test_canonical_path_root(self):
136
work_tree = self.make_branch_and_tree('tree')
137
self.build_tree(['tree/dir/', 'tree/dir/file'])
138
work_tree.add(['dir', 'dir/file'])
139
work_tree.commit('commit 1')
140
self.assertEqual(work_tree.get_canonical_path(''), '')
141
self.assertEqual(work_tree.get_canonical_path('/'), '/')
143
def test_canonical_path_invalid_all(self):
144
work_tree = self.make_branch_and_tree('tree')
145
self.build_tree(['tree/dir/', 'tree/dir/file'])
146
work_tree.add(['dir', 'dir/file'])
147
work_tree.commit('commit 1')
148
self.assertEqual(work_tree.get_canonical_path('foo/bar'), 'foo/bar')
150
def test_canonical_invalid_child(self):
151
work_tree = self.make_branch_and_tree('tree')
152
self.build_tree(['tree/dir/', 'tree/dir/file'])
153
work_tree.add(['dir', 'dir/file'])
154
work_tree.commit('commit 1')
155
self.assertEqual(work_tree.get_canonical_path('Dir/None'), 'dir/None')