/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 bzrlib/tests/test_errors.py

New method ``WorkingTree.flush()`` which will write the current memory
inventory out to disk. At the same time, read_working_inventory will
no longer trash the current tree inventory if it has been modified within
the current lock, and the tree will now ``flush()`` automatically on
``unlock()``. ``WorkingTree.set_root_id()`` has been updated to take
advantage of this functionality. (Robert Collins, John Arbash Meinel)

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_no_repo(self):
30
37
        dir = bzrdir.BzrDir.create(self.get_url())
31
38
        error = errors.NoRepositoryPresent(dir)
38
45
            "atree.",
39
46
            str(error))
40
47
 
 
48
    def test_not_write_locked(self):
 
49
        error = errors.NotWriteLocked('a thing to repr')
 
50
        self.assertEqualDiff("'a thing to repr' is not write locked but needs "
 
51
            "to be.",
 
52
            str(error))
 
53
 
41
54
    def test_up_to_date(self):
42
55
        error = errors.UpToDateFormat(bzrdir.BzrDirFormat4())
43
56
        self.assertEqualDiff("The branch format Bazaar-NG branch, "