~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: 2007-08-28 13:02:28 UTC
  • mfrom: (2759.1.1 ianc-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20070828130228-rv0k8180v9n4vj90
(Daniel Watkins) Clean-up error messages quoting parameters when necessary

Show diffs side-by-side

added added

removed removed

Lines of Context:
84
84
    def test_knit_header_error(self):
85
85
        error = errors.KnitHeaderError('line foo\n', 'path/to/file')
86
86
        self.assertEqual("Knit header error: 'line foo\\n' unexpected"
87
 
                         " for file path/to/file", str(error))
 
87
                         " for file \"path/to/file\".", str(error))
88
88
 
89
89
    def test_knit_index_unknown_method(self):
90
90
        error = errors.KnitIndexUnknownMethod('http://host/foo.kndx',
118
118
 
119
119
    def test_no_such_id(self):
120
120
        error = errors.NoSuchId("atree", "anid")
121
 
        self.assertEqualDiff("The file id anid is not present in the tree "
 
121
        self.assertEqualDiff("The file id \"anid\" is not present in the tree "
122
122
            "atree.",
123
123
            str(error))
124
124
 
125
125
    def test_no_such_revision_in_tree(self):
126
126
        error = errors.NoSuchRevisionInTree("atree", "anid")
127
 
        self.assertEqualDiff("The revision id anid is not present in the tree "
128
 
            "atree.",
129
 
            str(error))
 
127
        self.assertEqualDiff("The revision id {anid} is not present in the"
 
128
                             " tree atree.", str(error))
130
129
        self.assertIsInstance(error, errors.NoSuchRevision)
131
130
 
132
131
    def test_not_write_locked(self):
353
352
        """Test the formatting of DuplicateRecordNameError."""
354
353
        e = errors.DuplicateRecordNameError(u"n\xe5me".encode('utf-8'))
355
354
        self.assertEqual(
356
 
            "Container has multiple records with the same name: \"n\xc3\xa5me\"",
 
355
            "Container has multiple records with the same name: n\xc3\xa5me",
357
356
            str(e))
358
357
 
359
358