/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/plugins/weave_fmt/test_repository.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:
22
22
 
23
23
from __future__ import absolute_import
24
24
 
25
 
from cStringIO import StringIO
26
25
from stat import S_ISDIR
27
26
import sys
28
27
 
29
 
from bzrlib.bzrdir import (
 
28
from ...bzrdir import (
30
29
    BzrDirMetaFormat1,
31
30
    )
32
 
from bzrlib.errors import (
 
31
from ...errors import (
33
32
    IllegalPath,
34
33
    NoSuchFile,
35
34
    )
36
 
from bzrlib.repository import (
 
35
from ...repository import (
37
36
    InterRepository,
38
37
    Repository,
39
38
    )
40
 
from bzrlib.serializer import (
 
39
from ...serializer import (
41
40
    format_registry as serializer_format_registry,
42
41
    )
43
 
from bzrlib.tests import (
 
42
from ...sixish import (
 
43
    BytesIO,
 
44
    )
 
45
from ...tests import (
44
46
    TestCase,
45
47
    TestCaseWithTransport,
46
48
    )
47
49
 
48
 
from bzrlib.plugins.weave_fmt import xml4
49
 
from bzrlib.plugins.weave_fmt.bzrdir import (
 
50
from . import xml4
 
51
from .bzrdir import (
50
52
    BzrDirFormat6,
51
53
    )
52
 
from bzrlib.plugins.weave_fmt.repository import (
 
54
from .repository import (
53
55
    InterWeaveRepo,
54
56
    RepositoryFormat4,
55
57
    RepositoryFormat5,
253
255
    def test_is_compatible_and_registered(self):
254
256
        # InterWeaveRepo is compatible when either side
255
257
        # is a format 5/6/7 branch
256
 
        from bzrlib.repofmt import knitrepo
 
258
        from ...repofmt import knitrepo
257
259
        formats = [RepositoryFormat5(),
258
260
                   RepositoryFormat6(),
259
261
                   RepositoryFormat7()]
310
312
 
311
313
    def test_canned_inventory(self):
312
314
        """Test unpacked a canned inventory v4 file."""
313
 
        inp = StringIO(_working_inventory_v4)
 
315
        inp = BytesIO(_working_inventory_v4)
314
316
        inv = xml4.serializer_v4.read_inventory(inp)
315
317
        self.assertEqual(len(inv), 4)
316
318
        self.assertTrue(inv.has_id('bar-20050901064931-73b4b1138abc9cd2'))
317
319
 
318
320
    def test_unpack_revision(self):
319
321
        """Test unpacking a canned revision v4"""
320
 
        inp = StringIO(_revision_v4)
 
322
        inp = BytesIO(_revision_v4)
321
323
        rev = xml4.serializer_v4.read_revision(inp)
322
324
        eq = self.assertEqual
323
325
        eq(rev.committer,