~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_errors.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-10-16 04:21:07 UTC
  • mfrom: (1986.5.8 init-tree-overhead)
  • Revision ID: pqm@pqm.ubuntu.com-20061016042107-3868eeaa654059ae
(Robert Collins, John Arbash Meinel) Reduce inventory write operations during tree construction by making tree inventory writes occur at tree unlock time. This adds WorkingTree.flush() and alters set_root_id to not write the inventory.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
class TestErrors(TestCaseWithTransport):
28
28
 
 
29
    def test_inventory_modified(self):
 
30
        error = errors.InventoryModified("a tree to be repred")
 
31
        self.assertEqualDiff("The current inventory for the tree 'a tree to "
 
32
            "be repred' has been modified, so a clean inventory cannot be "
 
33
            "read without data loss.",
 
34
            str(error))
 
35
 
29
36
    def test_medium_not_connected(self):
30
37
        error = errors.MediumNotConnected("a medium")
31
38
        self.assertEqualDiff(
49
56
            "atree.",
50
57
            str(error))
51
58
 
 
59
    def test_not_write_locked(self):
 
60
        error = errors.NotWriteLocked('a thing to repr')
 
61
        self.assertEqualDiff("'a thing to repr' is not write locked but needs "
 
62
            "to be.",
 
63
            str(error))
 
64
 
52
65
    def test_too_many_concurrent_requests(self):
53
66
        error = errors.TooManyConcurrentRequests("a medium")
54
67
        self.assertEqualDiff("The medium 'a medium' has reached its concurrent "