~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_errors.py

  • Committer: Martin Pool
  • Date: 2009-07-27 06:28:35 UTC
  • mto: This revision was merged to the branch mainline in revision 4587.
  • Revision ID: mbp@sourcefrog.net-20090727062835-o66p8it658tq1sma
Add CountedLock.get_physical_lock_status

Show diffs side-by-side

added added

removed removed

Lines of Context:
87
87
            "reason: reason for foo",
88
88
            str(error))
89
89
 
 
90
    def test_inconsistent_delta_delta(self):
 
91
        error = errors.InconsistentDeltaDelta([], 'reason')
 
92
        self.assertEqualDiff(
 
93
            "An inconsistent delta was supplied: []\nreason: reason",
 
94
            str(error))
 
95
 
90
96
    def test_in_process_transport(self):
91
97
        error = errors.InProcessTransport('fpp')
92
98
        self.assertEqualDiff(
114
120
            "read without data loss.",
115
121
            str(error))
116
122
 
117
 
    def test_install_failed(self):
118
 
        error = errors.InstallFailed(['rev-one'])
119
 
        self.assertEqual("Could not install revisions:\nrev-one", str(error))
120
 
        error = errors.InstallFailed(['rev-one', 'rev-two'])
121
 
        self.assertEqual("Could not install revisions:\nrev-one, rev-two",
122
 
                         str(error))
123
 
        error = errors.InstallFailed([None])
124
 
        self.assertEqual("Could not install revisions:\nNone", str(error))
 
123
    def test_jail_break(self):
 
124
        error = errors.JailBreak("some url")
 
125
        self.assertEqualDiff("An attempt to access a url outside the server"
 
126
            " jail was made: 'some url'.",
 
127
            str(error))
125
128
 
126
129
    def test_lock_active(self):
127
130
        error = errors.LockActive("lock description")
245
248
            "You will need to upgrade the branch to permit branch stacking.",
246
249
            str(error))
247
250
 
 
251
    def test_unstackable_location(self):
 
252
        error = errors.UnstackableLocationError('foo', 'bar')
 
253
        self.assertEqualDiff("The branch 'foo' cannot be stacked on 'bar'.",
 
254
            str(error))
 
255
 
248
256
    def test_unstackable_repository_format(self):
249
257
        format = u'foo'
250
258
        url = "/foo"