~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_export.py

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
86
86
    def test_tar_export_ignores_bzr(self):
87
87
        tree = self.make_tree_with_extra_bzr_files()
88
88
 
89
 
        self.failUnless(tree.has_filename('.bzrignore'))
90
 
        self.failUnless(tree.has_filename('.bzrrules'))
91
 
        self.failUnless(tree.has_filename('.bzr-adir'))
92
 
        self.failUnless(tree.has_filename('.bzr-adir/afile'))
 
89
        self.assertTrue(tree.has_filename('.bzrignore'))
 
90
        self.assertTrue(tree.has_filename('.bzrrules'))
 
91
        self.assertTrue(tree.has_filename('.bzr-adir'))
 
92
        self.assertTrue(tree.has_filename('.bzr-adir/afile'))
93
93
        self.run_bzr('export test.tar.gz -d tree')
94
94
        ball = tarfile.open('test.tar.gz')
95
95
        # Make sure the tarball contains 'a', but does not contain
126
126
    def test_zip_export_ignores_bzr(self):
127
127
        tree = self.make_tree_with_extra_bzr_files()
128
128
 
129
 
        self.failUnless(tree.has_filename('.bzrignore'))
130
 
        self.failUnless(tree.has_filename('.bzrrules'))
131
 
        self.failUnless(tree.has_filename('.bzr-adir'))
132
 
        self.failUnless(tree.has_filename('.bzr-adir/afile'))
 
129
        self.assertTrue(tree.has_filename('.bzrignore'))
 
130
        self.assertTrue(tree.has_filename('.bzrrules'))
 
131
        self.assertTrue(tree.has_filename('.bzr-adir'))
 
132
        self.assertTrue(tree.has_filename('.bzr-adir/afile'))
133
133
        self.run_bzr('export test.zip -d tree')
134
134
 
135
135
        zfile = zipfile.ZipFile('test.zip')
252
252
        self.run_bzr('ignore something')
253
253
        tree.commit('1')
254
254
 
255
 
        self.failUnless(tree.has_filename('.bzrignore'))
256
 
        self.failUnless(tree.has_filename('.bzrrules'))
257
 
        self.failUnless(tree.has_filename('.bzr-adir'))
258
 
        self.failUnless(tree.has_filename('.bzr-adir/afile'))
 
255
        self.assertTrue(tree.has_filename('.bzrignore'))
 
256
        self.assertTrue(tree.has_filename('.bzrrules'))
 
257
        self.assertTrue(tree.has_filename('.bzr-adir'))
 
258
        self.assertTrue(tree.has_filename('.bzr-adir/afile'))
259
259
        self.run_bzr('export direxport')
260
260
 
261
261
        files = sorted(os.listdir('direxport'))
298
298
        os.chdir('branch')
299
299
 
300
300
        self.run_bzr('export ../first.tar -r 1')
301
 
        self.failUnless(os.path.isfile('../first.tar'))
 
301
        self.assertTrue(os.path.isfile('../first.tar'))
302
302
        tf = tarfile.open('../first.tar')
303
303
        try:
304
304
            self.assertEqual(['first/hello'], sorted(tf.getnames()))
307
307
            tf.close()
308
308
 
309
309
        self.run_bzr('export ../first.tar.gz -r 1')
310
 
        self.failUnless(os.path.isfile('../first.tar.gz'))
 
310
        self.assertTrue(os.path.isfile('../first.tar.gz'))
311
311
        self.run_bzr('export ../first.tbz2 -r 1')
312
 
        self.failUnless(os.path.isfile('../first.tbz2'))
 
312
        self.assertTrue(os.path.isfile('../first.tbz2'))
313
313
        self.run_bzr('export ../first.tar.bz2 -r 1')
314
 
        self.failUnless(os.path.isfile('../first.tar.bz2'))
 
314
        self.assertTrue(os.path.isfile('../first.tar.bz2'))
315
315
        self.run_bzr('export ../first.tar.tbz2 -r 1')
316
 
        self.failUnless(os.path.isfile('../first.tar.tbz2'))
 
316
        self.assertTrue(os.path.isfile('../first.tar.tbz2'))
317
317
 
318
318
        tf = tarfile.open('../first.tar.tbz2', 'r:bz2')
319
319
        try:
334
334
        os.chdir('branch')
335
335
 
336
336
        self.run_bzr('export ../first.zip -r 1')
337
 
        self.failUnlessExists('../first.zip')
 
337
        self.assertPathExists('../first.zip')
338
338
        zf = zipfile.ZipFile('../first.zip')
339
339
        try:
340
340
            self.assertEqual(['first/hello'], sorted(zf.namelist()))