/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 breezy/tests/blackbox/test_export.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-22 00:56:52 UTC
  • mfrom: (6621.2.26 py3_pokes)
  • Revision ID: jelmer@jelmer.uk-20170522005652-yjahcr9hwmjkno7n
Merge Python3 porting work ('py3 pokes')

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
"""Black-box tests for brz export.
19
19
"""
20
20
 
21
 
from StringIO import StringIO
22
21
import os
23
22
import stat
24
23
import tarfile
26
25
import zipfile
27
26
 
28
27
 
29
 
from breezy import (
 
28
from ... import (
30
29
    export,
31
30
    )
32
 
from breezy.tests import (
 
31
from ...sixish import (
 
32
    BytesIO,
 
33
    )
 
34
from .. import (
33
35
    features,
34
36
    TestCaseWithTransport,
35
37
    )
36
 
from breezy.tests.matchers import ContainsNoVfsCalls
 
38
from ..matchers import ContainsNoVfsCalls
37
39
 
38
40
 
39
41
class TestExport(TestCaseWithTransport):
151
153
    def test_zip_export_stdout(self):
152
154
        tree = self.make_basic_tree()
153
155
        contents = self.run_bzr('export -d tree --format=zip -')[0]
154
 
        self.assertZipANameAndContent(zipfile.ZipFile(StringIO(contents)))
 
156
        self.assertZipANameAndContent(zipfile.ZipFile(BytesIO(contents)))
155
157
 
156
158
    def test_zip_export_file(self):
157
159
        tree = self.make_basic_tree()
180
182
        ball = tarfile.open(fname, mode=mode)
181
183
        self.assertTarANameAndContent(ball, root='test/')
182
184
        content = self.run_bzr('export -d tree --format=%s -' % (extension,))[0]
183
 
        ball = tarfile.open(mode=mode, fileobj=StringIO(content))
 
185
        ball = tarfile.open(mode=mode, fileobj=BytesIO(content))
184
186
        self.assertTarANameAndContent(ball, root='')
185
187
 
186
188
    def test_tar_export(self):