133
133
tree = self.get_tree_with_utf8(tree)
135
135
revision_id = u'r\xe9v-1'.encode('utf8')
136
path_and_ids = [(u'', u'TREE_ROOT', None),
137
(u'b\xe5r', u'b\xe5r-id', u'TREE_ROOT'),
138
(u'f\xf6', u'f\xf6-id', u'TREE_ROOT'),
139
(u'b\xe5r/b\xe1z', u'b\xe1z-id', u'b\xe5r-id'),
136
root_id = 'TREE_ROOT'
137
bar_id = u'b\xe5r-id'.encode('utf8')
138
foo_id = u'f\xf6-id'.encode('utf8')
139
baz_id = u'b\xe1z-id'.encode('utf8')
140
path_and_ids = [(u'', root_id, None),
141
(u'b\xe5r', bar_id, root_id),
142
(u'f\xf6', foo_id, root_id),
143
(u'b\xe5r/b\xe1z', baz_id, bar_id),
148
152
self.assertEqual(expected[0], path) # Paths should match
149
153
self.assertIsInstance(path, unicode)
150
154
self.assertEqual(expected[1], ie.file_id)
151
if isinstance(ie.file_id, str):
152
# file_ids might be plain strings, but only if they are ascii
153
ie.file_id.decode('ascii')
155
self.assertIsInstance(ie.file_id, unicode)
155
self.assertIsInstance(ie.file_id, str)
156
156
self.assertEqual(expected[2], ie.parent_id)
157
157
if expected[2] is not None:
158
if isinstance(ie.parent_id, str):
159
ie.parent_id.decode('ascii')
161
self.assertIsInstance(ie.parent_id, unicode)
158
self.assertIsInstance(ie.parent_id, str)
162
159
# WorkingTree's return None for the last modified revision
163
160
if ie.revision is not None:
164
161
self.assertIsInstance(ie.revision, str)
181
178
revision_id_1 = u'r\xe9v-1'.encode('utf8')
182
179
revision_id_2 = u'r\xe9v-2'.encode('utf8')
183
path_and_ids = [(u'', u'TREE_ROOT', None, None),
184
(u'b\xe5r', u'b\xe5r-id', u'TREE_ROOT', revision_id_1),
185
(u'f\xf6', u'f\xf6-id', u'TREE_ROOT', revision_id_1),
186
(u'b\xe5r/b\xe1z', u'b\xe1z-id', u'b\xe5r-id',
188
(u'b\xe5r/z\xf7z', u'z\xf7z-id', u'b\xe5r-id',
180
root_id = 'TREE_ROOT'
181
bar_id = u'b\xe5r-id'.encode('utf8')
182
foo_id = u'f\xf6-id'.encode('utf8')
183
baz_id = u'b\xe1z-id'.encode('utf8')
184
zez_id = u'z\xf7z-id'.encode('utf8')
185
path_and_ids = [(u'', root_id, None, None),
186
(u'b\xe5r', bar_id, root_id, revision_id_1),
187
(u'f\xf6', foo_id, root_id, revision_id_1),
188
(u'b\xe5r/b\xe1z', baz_id, bar_id, revision_id_1),
189
(u'b\xe5r/z\xf7z', zez_id, bar_id, revision_id_2),
198
198
self.assertEqual(expected[0], path) # Paths should match
199
199
self.assertIsInstance(path, unicode)
200
200
self.assertEqual(expected[1], ie.file_id)
201
if isinstance(ie.file_id, str):
202
# file_ids might be plain strings, but only if they are ascii
203
ie.file_id.decode('ascii')
205
self.assertIsInstance(ie.file_id, unicode)
201
self.assertIsInstance(ie.file_id, str)
206
202
self.assertEqual(expected[2], ie.parent_id)
207
203
if expected[2] is not None:
208
if isinstance(ie.parent_id, str):
209
ie.parent_id.decode('ascii')
211
self.assertIsInstance(ie.parent_id, unicode)
204
self.assertIsInstance(ie.parent_id, str)
212
205
# WorkingTree's return None for the last modified revision
213
206
if ie.revision is not None:
214
207
self.assertIsInstance(ie.revision, str)