~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-02-11 04:02:41 UTC
  • mfrom: (5017.2.2 tariff)
  • Revision ID: pqm@pqm.ubuntu.com-20100211040241-w6n021dz0uus341n
(mbp) add import-tariff tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2010 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2008 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
30
30
    export,
31
31
    tests,
32
32
    )
33
 
from bzrlib.tests import TestCaseWithTransport
34
 
 
35
 
 
36
 
class TestExport(TestCaseWithTransport):
 
33
from bzrlib.tests.blackbox import ExternalBase
 
34
 
 
35
 
 
36
class TestExport(ExternalBase):
37
37
 
38
38
    def test_tar_export(self):
39
39
        tree = self.make_branch_and_tree('tar')
85
85
        self.assertEqual(['test/' + fname.encode('utf8')],
86
86
                         sorted(ball.getnames()))
87
87
 
88
 
    def test_tar_export_unicode_basedir(self):
89
 
        """Test for bug #413406"""
90
 
        basedir = u'\N{euro sign}'
91
 
        os.mkdir(basedir)
92
 
        os.chdir(basedir)
93
 
        self.run_bzr(['init', 'branch'])
94
 
        os.chdir('branch')
95
 
        self.run_bzr(['export', '--format', 'tgz', u'test.tar.gz'])
96
 
 
97
88
    def test_zip_export(self):
98
89
        tree = self.make_branch_and_tree('zip')
99
90
        self.build_tree(['zip/a'])
302
293
        tree.commit('more setup')
303
294
        out, err = self.run_bzr('export exported branch/subdir')
304
295
        self.assertEqual(['foo.txt'], os.listdir('exported'))
305
 
 
306
 
    def test_dir_export_per_file_timestamps(self):
307
 
        tree = self.example_branch()
308
 
        self.build_tree_contents([('branch/har', 'foo')])
309
 
        tree.add('har')
310
 
        # Earliest allowable date on FAT32 filesystems is 1980-01-01
311
 
        tree.commit('setup', timestamp=315532800)
312
 
        self.run_bzr('export --per-file-timestamps t branch')
313
 
        har_st = os.stat('t/har')
314
 
        self.assertEquals(315532800, har_st.st_mtime)
315
 
 
316
 
    def test_export_directory(self):
317
 
        """Test --directory option"""
318
 
        self.example_branch()
319
 
        self.run_bzr(['export', '--directory=branch', 'latest'])
320
 
        self.assertEqual(['goodbye', 'hello'], sorted(os.listdir('latest')))
321
 
        self.check_file_contents('latest/goodbye', 'baz')