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

  • Committer: Jelmer Vernooij
  • Date: 2018-02-18 21:42:57 UTC
  • mto: This revision was merged to the branch mainline in revision 6859.
  • Revision ID: jelmer@jelmer.uk-20180218214257-jpevutp1wa30tz3v
Update TODO to reference Breezy, not Bazaar.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
    controldir,
22
22
    tests,
23
23
    )
24
 
from breezy.repository import WriteGroup
25
24
from breezy.bzr import (
26
25
    inventory,
27
26
    )
 
27
from breezy.tests.matchers import ContainsNoVfsCalls
28
28
 
29
29
 
30
30
class TrivialTest(tests.TestCaseWithTransport):
50
50
        t = controldir.ControlDir.create_standalone_workingtree('.')
51
51
        # an empty inventory with no revision will trigger reconciliation.
52
52
        repo = t.branch.repository
53
 
        inv = inventory.Inventory(revision_id=b'missing')
54
 
        inv.root.revision = b'missing'
 
53
        inv = inventory.Inventory(revision_id='missing')
 
54
        inv.root.revision='missing'
55
55
        repo.lock_write()
56
 
        with repo.lock_write(), WriteGroup(repo):
57
 
            repo.add_inventory(b'missing', inv, [])
 
56
        repo.start_write_group()
 
57
        repo.add_inventory('missing', inv, [])
 
58
        repo.commit_write_group()
 
59
        repo.unlock()
58
60
        (out, err) = self.run_bzr('reconcile')
59
61
        if repo._reconcile_backsup_inventory:
60
62
            does_backup_text = (
72
74
                     does_backup_text))
73
75
        self.assertEqualDiff(expected, out)
74
76
        self.assertEqualDiff(err, "")
 
77
 
 
78
 
 
79
class TestSmartServerReconcile(tests.TestCaseWithTransport):
 
80
 
 
81
    def test_simple_reconcile(self):
 
82
        self.setup_smart_server_with_call_log()
 
83
        self.make_branch('branch')
 
84
        self.reset_smart_call_log()
 
85
        out, err = self.run_bzr(['reconcile', self.get_url('branch')])
 
86
        # This figure represent the amount of work to perform this use case. It
 
87
        # is entirely ok to reduce this number if a test fails due to rpc_count
 
88
        # being too low. If rpc_count increases, more network roundtrips have
 
89
        # become necessary for this use case. Please do not adjust this number
 
90
        # upwards without agreement from bzr's network support maintainers.
 
91
        self.assertLength(10, self.hpss_calls)
 
92
        self.assertLength(1, self.hpss_connections)
 
93
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)