~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_errors.py

  • Committer: Alexander Belchenko
  • Date: 2008-02-16 10:03:17 UTC
  • mfrom: (3224 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3230.
  • Revision ID: bialix@ukr.net-20080216100317-xg1hdw306evlgt94
merge bzr.dev; update for 1.3; $BZR_LOG used in trace.py module (again), not in the main bzr script (req. by Robert Collins)

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(