170
170
def archive_test(self, builder, importer, subdir=False):
171
171
archive_file = self.make_archive(builder, subdir)
172
172
tree = BzrDir.create_standalone_workingtree('tree')
173
importer(tree, archive_file)
174
self.assertTrue(tree.path2id('README') is not None)
175
self.assertTrue(tree.path2id('FEEDME') is not None)
176
self.assertTrue(os.path.isfile(tree.abspath('README')))
177
self.assertEqual(tree.inventory[tree.path2id('README')].kind, 'file')
178
self.assertEqual(tree.inventory[tree.path2id('FEEDME')].kind, 'file')
180
f = file(tree.abspath('junk/food'), 'wb')
181
f.write('I like food\n')
175
importer(tree, archive_file)
176
self.assertTrue(tree.path2id('README') is not None)
177
self.assertTrue(tree.path2id('FEEDME') is not None)
178
self.assertTrue(os.path.isfile(tree.abspath('README')))
179
self.assertEqual(tree.inventory[tree.path2id('README')].kind,
181
self.assertEqual(tree.inventory[tree.path2id('FEEDME')].kind,
183
f = file(tree.abspath('junk/food'), 'wb')
184
f.write('I like food\n')
184
archive_file = self.make_archive2(builder, subdir)
185
importer(tree, archive_file)
186
self.assertTrue(tree.path2id('README') is not None)
187
self.assertTrue(not os.path.exists(tree.abspath('FEEDME')))
187
archive_file = self.make_archive2(builder, subdir)
188
importer(tree, archive_file)
189
self.assertTrue(tree.path2id('README') is not None)
190
self.assertTrue(not os.path.exists(tree.abspath('FEEDME')))
190
195
def test_untar2(self):