/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 brzlib/tests/test_reconcile.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-21 12:41:27 UTC
  • mto: This revision was merged to the branch mainline in revision 6623.
  • Revision ID: jelmer@jelmer.uk-20170521124127-iv8etg0vwymyai6y
s/bzr/brz/ in apport config.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
"""Tests for reconiliation behaviour that is repository independent."""
18
18
 
19
19
 
20
 
from breezy import (
 
20
from brzlib import (
 
21
    bzrdir,
21
22
    errors,
22
23
    tests,
23
24
    )
24
 
from breezy.bzr import (
25
 
    bzrdir,
26
 
    )
27
 
from breezy.reconcile import reconcile, Reconciler
28
 
from breezy.tests import per_repository
 
25
from brzlib.reconcile import reconcile, Reconciler
 
26
from brzlib.tests import per_repository
29
27
 
30
28
 
31
29
class TestWorksWithSharedRepositories(per_repository.TestCaseWithRepository):
38
36
        child = bzrdir.BzrDirMetaFormat1().initialize('child')
39
37
        self.assertRaises(errors.NoRepositoryPresent, child.open_repository)
40
38
        reconciler = Reconciler(child)
41
 
        result = reconciler.reconcile()
 
39
        reconciler.reconcile()
42
40
        # smoke test for reconcile appears to work too.
43
41
        reconcile(child)
44
42
        # no inconsistent parents should have been found
45
43
        # but the values should have been set.
46
 
        self.assertEqual(0, result.inconsistent_parents)
 
44
        self.assertEqual(0, reconciler.inconsistent_parents)
47
45
        # and no garbage inventories
48
 
        self.assertEqual(0, result.garbage_inventories)
 
46
        self.assertEqual(0, reconciler.garbage_inventories)
49
47
 
50
48
 
51
49
class TestReconciler(tests.TestCaseWithTransport):
52
50
 
53
51
    def test_reconciler_with_no_branch(self):
54
52
        repo = self.make_repository('repo')
55
 
        reconciler = Reconciler(repo.controldir)
56
 
        result = reconciler.reconcile()
 
53
        reconciler = Reconciler(repo.bzrdir)
 
54
        reconciler.reconcile()
57
55
        # no inconsistent parents should have been found
58
56
        # but the values should have been set.
59
 
        self.assertEqual(0, result.inconsistent_parents)
 
57
        self.assertEqual(0, reconciler.inconsistent_parents)
60
58
        # and no garbage inventories
61
 
        self.assertEqual(0, result.garbage_inventories)
62
 
        self.assertIs(None, result.fixed_branch_history)
 
59
        self.assertEqual(0, reconciler.garbage_inventories)
 
60
        self.assertIs(None, reconciler.fixed_branch_history)
63
61
 
64
62
    def test_reconciler_finds_branch(self):
65
63
        a_branch = self.make_branch('a_branch')
66
 
        reconciler = Reconciler(a_branch.controldir)
67
 
        result = reconciler.reconcile()
 
64
        reconciler = Reconciler(a_branch.bzrdir)
 
65
        reconciler.reconcile()
68
66
 
69
67
        # It should have checked the repository, and the branch
70
 
        self.assertEqual(0, result.inconsistent_parents)
71
 
        self.assertEqual(0, result.garbage_inventories)
72
 
        self.assertIs(False, result.fixed_branch_history)
 
68
        self.assertEqual(0, reconciler.inconsistent_parents)
 
69
        self.assertEqual(0, reconciler.garbage_inventories)
 
70
        self.assertIs(False, reconciler.fixed_branch_history)