/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

  • Committer: Aaron Bentley
  • Date: 2007-07-17 13:27:14 UTC
  • mfrom: (2624 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2631.
  • Revision ID: abentley@panoramicfeedback.com-20070717132714-tmzx9khmg9501k51
Merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
166
166
                             repo.bzrdir.root_transport.base,
167
167
                             str(error))
168
168
 
 
169
    def test_read_error(self):
 
170
        # a unicode path to check that %r is being used.
 
171
        path = u'a path'
 
172
        error = errors.ReadError(path)
 
173
        self.assertEqualDiff("Error reading from u'a path'.", str(error))
 
174
 
 
175
    def test_bad_index_format_signature(self):
 
176
        error = errors.BadIndexFormatSignature("foo", "bar")
 
177
        self.assertEqual("foo is not an index of type bar.",
 
178
            str(error))
 
179
 
 
180
    def test_bad_index_data(self):
 
181
        error = errors.BadIndexData("foo")
 
182
        self.assertEqual("Error in data for index foo.",
 
183
            str(error))
 
184
 
 
185
    def test_bad_index_duplicate_key(self):
 
186
        error = errors.BadIndexDuplicateKey("foo", "bar")
 
187
        self.assertEqual("The key 'foo' is already in index 'bar'.",
 
188
            str(error))
 
189
 
 
190
    def test_bad_index_key(self):
 
191
        error = errors.BadIndexKey("foo")
 
192
        self.assertEqual("The key 'foo' is not a valid key.",
 
193
            str(error))
 
194
 
 
195
    def test_bad_index_options(self):
 
196
        error = errors.BadIndexOptions("foo")
 
197
        self.assertEqual("Could not parse options for index foo.",
 
198
            str(error))
 
199
 
 
200
    def test_bad_index_value(self):
 
201
        error = errors.BadIndexValue("foo")
 
202
        self.assertEqual("The value 'foo' is not a valid value.",
 
203
            str(error))
 
204
 
169
205
    def test_bzrnewerror_is_deprecated(self):
170
206
        class DeprecatedError(errors.BzrNewError):
171
207
            pass
205
241
            str(error))
206
242
 
207
243
    def test_transport_not_possible(self):
208
 
        e = errors.TransportNotPossible('readonly', 'original error')
209
 
        self.assertEqual('Transport operation not possible:'
210
 
                         ' readonly original error', str(e))
 
244
        error = errors.TransportNotPossible('readonly', 'original error')
 
245
        self.assertEqualDiff('Transport operation not possible:'
 
246
                         ' readonly original error', str(error))
211
247
 
212
248
    def assertSocketConnectionError(self, expected, *args, **kwargs):
213
249
        """Check the formatting of a SocketConnectionError exception"""
360
396
        e = ErrorWithBadFormat(not_thing='x')
361
397
        self.assertStartsWith(
362
398
            str(e), 'Unprintable exception ErrorWithBadFormat')
363