~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_errors.py

  • Committer: Martin Pool
  • Date: 2007-04-24 05:02:04 UTC
  • mfrom: (2449 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2450.
  • Revision ID: mbp@sourcefrog.net-20070424050204-bfkc1qiq0axt5f14
Merge trunk & fix NEWS conflict

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
        self.assertEqualDiff('File id {a_file_id} already exists in inventory'
41
41
                             ' as foo', str(error))
42
42
 
 
43
    def test_duplicate_help_prefix(self):
 
44
        error = errors.DuplicateHelpPrefix('foo')
 
45
        self.assertEqualDiff('The prefix foo is in the help search path twice.',
 
46
            str(error))
 
47
 
43
48
    def test_inventory_modified(self):
44
49
        error = errors.InventoryModified("a tree to be repred")
45
50
        self.assertEqualDiff("The current inventory for the tree 'a tree to "
91
96
            "smart protocol.",
92
97
            str(error))
93
98
 
 
99
    def test_no_help_topic(self):
 
100
        error = errors.NoHelpTopic("topic")
 
101
        self.assertEqualDiff("No help could be found for 'topic'. "
 
102
            "Please use 'bzr help topics' to obtain a list of topics.",
 
103
            str(error))
 
104
 
94
105
    def test_no_such_id(self):
95
106
        error = errors.NoSuchId("atree", "anid")
96
107
        self.assertEqualDiff("The file id anid is not present in the tree "
119
130
        error = errors.TooManyConcurrentRequests("a medium")
120
131
        self.assertEqualDiff("The medium 'a medium' has reached its concurrent "
121
132
            "request limit. Be sure to finish_writing and finish_reading on "
122
 
            "the current request that is open.",
 
133
            "the currently open request.",
123
134
            str(error))
124
135
 
125
136
    def test_unknown_hook(self):
233
244
            host='ahost', port=444, msg='Unable to connect to ssh host',
234
245
            orig_error='my_error')
235
246
 
 
247
    def test_malformed_bug_identifier(self):
 
248
        """Test the formatting of MalformedBugIdentifier."""
 
249
        error = errors.MalformedBugIdentifier('bogus', 'reason for bogosity')
 
250
        self.assertEqual(
 
251
            "Did not understand bug identifier bogus: reason for bogosity",
 
252
            str(error))
 
253
 
 
254
    def test_unknown_bug_tracker_abbreviation(self):
 
255
        """Test the formatting of UnknownBugTrackerAbbreviation."""
 
256
        branch = self.make_branch('some_branch')
 
257
        error = errors.UnknownBugTrackerAbbreviation('xxx', branch)
 
258
        self.assertEqual(
 
259
            "Cannot find registered bug tracker called xxx on %s" % branch,
 
260
            str(error))
 
261
 
 
262
    def test_unexpected_smart_server_response(self):
 
263
        e = errors.UnexpectedSmartServerResponse(('not yes',))
 
264
        self.assertEqual(
 
265
            "Could not understand response from smart server: ('not yes',)",
 
266
            str(e))
236
267
 
237
268
 
238
269
class PassThroughError(errors.BzrError):