/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/per_branch/test_check.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:
16
16
 
17
17
"""Tests for branch implementations - test check() functionality"""
18
18
 
19
 
from StringIO import StringIO
20
19
 
21
 
from bzrlib import errors, tests, ui
22
 
from bzrlib.symbol_versioning import deprecated_in
23
 
from bzrlib.tests.per_branch import TestCaseWithBranch
 
20
from ... import (
 
21
    errors,
 
22
    tests,
 
23
    ui,
 
24
)
 
25
from ...sixish import (
 
26
    BytesIO,
 
27
    )
 
28
from ...symbol_versioning import deprecated_in
 
29
from . import TestCaseWithBranch
24
30
 
25
31
 
26
32
class TestBranchCheck(TestCaseWithBranch):
53
59
        self.addCleanup(tree.unlock)
54
60
        refs = self.make_refs(tree.branch)
55
61
        result = tree.branch.check(refs)
56
 
        ui.ui_factory = tests.TestUIFactory(stdout=StringIO())
 
62
        ui.ui_factory = tests.TestUIFactory(stdout=BytesIO())
57
63
        result.report_results(True)
58
64
        self.assertContainsRe('revno does not match len',
59
65
            ui.ui_factory.stdout.getvalue())
72
78
        tree = self.make_branch_and_tree('.')
73
79
        revid = tree.commit('foo')
74
80
        self.assertEqual(
75
 
            set([('revision-existence', revid), ('lefthand-distance', revid)]),
 
81
            {('revision-existence', revid), ('lefthand-distance', revid)},
76
82
            set(tree.branch._get_check_refs()))
77
83
 
78
84
    def make_refs(self, branch):