~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2006-09-23 16:21:47 UTC
  • mto: This revision was merged to the branch mainline in revision 2036.
  • Revision ID: john@arbash-meinel.com-20060923162147-06b40d23f9cd2f47
In zip files, directories must have trailing slashes

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
"""
20
20
 
21
21
import os
 
22
import sys
22
23
import tarfile
23
24
import zipfile
24
25
 
95
96
        self.assertEqual(['test/' + fname.encode('utf8')],
96
97
                         sorted(zfile.namelist()))
97
98
 
 
99
    def test_zip_export_directories(self):
 
100
        tree = self.make_branch_and_tree('zip')
 
101
        self.build_tree(['zip/a', 'zip/b/', 'zip/b/c', 'zip/d/'])
 
102
        tree.add(['a', 'b', 'b/c', 'd'])
 
103
        tree.commit('init')
 
104
 
 
105
        os.chdir('zip')
 
106
        self.run_bzr('export', 'test.zip')
 
107
        zfile = zipfile.ZipFile('test.zip')
 
108
        names = sorted(zfile.namelist())
 
109
        if sys.platform == 'win32':
 
110
            self.assertEqual(['a', 'b\\', 'b\\c', 'd\\'], names)
 
111
        else:
 
112
            self.assertEqual(['a', 'b/', 'b/c', 'd/'], names)
 
113
 
98
114
    def test_dir_export(self):
99
115
        tree = self.make_branch_and_tree('dir')
100
116
        self.build_tree(['dir/a'])