/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/test_pack.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:
16
16
 
17
17
"""Tests for breezy.pack."""
18
18
 
19
 
 
20
 
from cStringIO import StringIO
21
 
 
22
 
from breezy import pack, errors, tests
 
19
from .. import pack, errors, tests
 
20
from ..sixish import (
 
21
    BytesIO,
 
22
    )
23
23
 
24
24
 
25
25
class TestContainerSerialiser(tests.TestCase):
74
74
 
75
75
    def setUp(self):
76
76
        super(TestContainerWriter, self).setUp()
77
 
        self.output = StringIO()
 
77
        self.output = BytesIO()
78
78
        self.writer = pack.ContainerWriter(self.output.write)
79
79
 
80
80
    def assertOutput(self, expected_output):
233
233
    """
234
234
 
235
235
    def get_reader_for(self, bytes):
236
 
        stream = StringIO(bytes)
 
236
        stream = BytesIO(bytes)
237
237
        reader = pack.ContainerReader(stream)
238
238
        return reader
239
239
 
373
373
    """
374
374
 
375
375
    def get_reader_for(self, bytes):
376
 
        stream = StringIO(bytes)
 
376
        stream = BytesIO(bytes)
377
377
        reader = pack.BytesRecordReader(stream)
378
378
        return reader
379
379
 
530
530
class TestMakeReadvReader(tests.TestCaseWithTransport):
531
531
 
532
532
    def test_read_skipping_records(self):
533
 
        pack_data = StringIO()
 
533
        pack_data = BytesIO()
534
534
        writer = pack.ContainerWriter(pack_data.write)
535
535
        writer.begin()
536
536
        memos = []