/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_branch.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:
22
22
also see this file.
23
23
"""
24
24
 
25
 
from cStringIO import StringIO
26
 
 
27
 
from breezy import (
 
25
from .. import (
28
26
    branch as _mod_branch,
29
27
    bzrdir,
30
28
    config,
34
32
    trace,
35
33
    urlutils,
36
34
    )
37
 
from breezy.branchfmt.fullhistory import (
 
35
from ..branchfmt.fullhistory import (
38
36
    BzrBranch5,
39
37
    BzrBranchFormat5,
40
38
    )
 
39
from ..sixish import (
 
40
    BytesIO,
 
41
    )
41
42
 
42
43
 
43
44
class TestDefaultFormat(tests.TestCase):
596
597
        self.assertStartsWith(param_repr, '<BranchInitHookParams of ')
597
598
 
598
599
    def test_post_switch_hook(self):
599
 
        from breezy import switch
 
600
        from .. import switch
600
601
        calls = []
601
602
        _mod_branch.Branch.hooks.install_named_hook('post_switch',
602
603
            calls.append, None)
710
711
        r.old_revno = 10
711
712
        r.new_revid = "new-revid"
712
713
        r.new_revno = 20
713
 
        f = StringIO()
 
714
        f = BytesIO()
714
715
        r.report(f)
715
716
        self.assertEqual("Now on revision 20.\n", f.getvalue())
716
717
        self.assertEqual("Now on revision 20.\n", f.getvalue())
719
720
        r = _mod_branch.PullResult()
720
721
        r.old_revid = "same-revid"
721
722
        r.new_revid = "same-revid"
722
 
        f = StringIO()
 
723
        f = BytesIO()
723
724
        r.report(f)
724
725
        self.assertEqual("No revisions or tags to pull.\n", f.getvalue())