/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

Viewing changes to breezy/tests/test_pack.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-24 01:39:33 UTC
  • mfrom: (3815.3776.6)
  • Revision ID: jelmer@jelmer.uk-20170524013933-ir4y4tqtrsiz2ka2
New upstream snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
"""Tests for bzrlib.pack."""
18
 
 
19
 
 
20
 
from cStringIO import StringIO
21
 
 
22
 
from bzrlib import pack, errors, tests
 
17
"""Tests for breezy.pack."""
 
18
 
 
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 = []