/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/tree_implementations/test_test_trees.py

  • Committer: John Arbash Meinel
  • Date: 2007-02-18 00:22:24 UTC
  • mto: This revision was merged to the branch mainline in revision 2298.
  • Revision ID: john@arbash-meinel.com-20070218002224-nfsw9ubivr178ahn
Switch all apis over to utf8 file ids. All tests pass

Show diffs side-by-side

added added

removed removed

Lines of Context:
133
133
        tree = self.get_tree_with_utf8(tree)
134
134
 
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),
140
144
                       ]
141
145
        tree.lock_read()
142
146
        try:
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')
154
 
            else:
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')
160
 
                else:
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)
180
177
 
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',
187
 
                            revision_id_1),
188
 
                        (u'b\xe5r/z\xf7z', u'z\xf7z-id', u'b\xe5r-id',
189
 
                            revision_id_2),
 
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),
190
190
                       ]
191
191
        tree.lock_read()
192
192
        try:
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')
204
 
            else:
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')
210
 
                else:
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)