~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: 2008-02-13 03:19:02 UTC
  • mfrom: (3221.1.8 prepare-1.2rc1)
  • Revision ID: pqm@pqm.ubuntu.com-20080213031902-4xhmwps49vclfhh6
Tweaked fix for #187169: if an illegal update is made to the dirstate, don't allow it to be written out.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006, 2007 Canonical Ltd
 
1
# Copyright (C) 2006, 2007, 2008 Canonical Ltd
2
2
#   Authors: Robert Collins <robert.collins@canonical.com>
3
3
#            and others
4
4
#
29
29
 
30
30
class TestErrors(TestCaseWithTransport):
31
31
 
 
32
    def test_corrupt_dirstate(self):
 
33
        error = errors.CorruptDirstate('path/to/dirstate', 'the reason why')
 
34
        self.assertEqualDiff(
 
35
            "Inconsistency in dirstate file path/to/dirstate.\n"
 
36
            "Error: the reason why",
 
37
            str(error))
 
38
 
32
39
    def test_disabled_method(self):
33
40
        error = errors.DisabledMethod("class name")
34
41
        self.assertEqualDiff(
51
58
            'It supports versions "(4, 5, 6)" to "(7, 8, 9)".',
52
59
            str(error))
53
60
 
 
61
    def test_inconsistent_delta(self):
 
62
        error = errors.InconsistentDelta('path', 'file-id', 'reason for foo')
 
63
        self.assertEqualDiff(
 
64
            "An inconsistent delta was supplied involving 'path', 'file-id'\n"
 
65
            "reason: reason for foo",
 
66
            str(error))
 
67
 
54
68
    def test_in_process_transport(self):
55
69
        error = errors.InProcessTransport('fpp')
56
70
        self.assertEqualDiff(