/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: Martin Pool
  • Date: 2007-09-03 04:35:49 UTC
  • mfrom: (2778 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2779.
  • Revision ID: mbp@sourcefrog.net-20070903043549-0cfyrgx7z2h8ppks
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
            "cannot be broken.",
82
82
            str(error))
83
83
 
 
84
    def test_knit_data_stream_incompatible(self):
 
85
        error = errors.KnitDataStreamIncompatible(
 
86
            'stream format', 'target format')
 
87
        self.assertEqual('Cannot insert knit data stream of format '
 
88
                         '"stream format" into knit of format '
 
89
                         '"target format".', str(error))
 
90
 
84
91
    def test_knit_header_error(self):
85
92
        error = errors.KnitHeaderError('line foo\n', 'path/to/file')
86
93
        self.assertEqual("Knit header error: 'line foo\\n' unexpected"
87
 
                         " for file path/to/file", str(error))
 
94
                         " for file \"path/to/file\".", str(error))
88
95
 
89
96
    def test_knit_index_unknown_method(self):
90
97
        error = errors.KnitIndexUnknownMethod('http://host/foo.kndx',
118
125
 
119
126
    def test_no_such_id(self):
120
127
        error = errors.NoSuchId("atree", "anid")
121
 
        self.assertEqualDiff("The file id anid is not present in the tree "
 
128
        self.assertEqualDiff("The file id \"anid\" is not present in the tree "
122
129
            "atree.",
123
130
            str(error))
124
131
 
125
132
    def test_no_such_revision_in_tree(self):
126
133
        error = errors.NoSuchRevisionInTree("atree", "anid")
127
 
        self.assertEqualDiff("The revision id anid is not present in the tree "
128
 
            "atree.",
129
 
            str(error))
 
134
        self.assertEqualDiff("The revision id {anid} is not present in the"
 
135
                             " tree atree.", str(error))
130
136
        self.assertIsInstance(error, errors.NoSuchRevision)
131
137
 
132
138
    def test_not_write_locked(self):
353
359
        """Test the formatting of DuplicateRecordNameError."""
354
360
        e = errors.DuplicateRecordNameError(u"n\xe5me".encode('utf-8'))
355
361
        self.assertEqual(
356
 
            "Container has multiple records with the same name: \"n\xc3\xa5me\"",
 
362
            "Container has multiple records with the same name: n\xc3\xa5me",
357
363
            str(e))
358
364
 
359
365