/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 breezy/tests/test_errors.py

  • Committer: Gustav Hartvigsson
  • Date: 2021-01-11 20:19:38 UTC
  • mfrom: (7526.3.2 work)
  • Revision ID: gustav.hartvigsson@gmail.com-20210111201938-omr9wjz3qdgyxe8k
MergedĀ lp:brz

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
            "^Filename b?'bad/filen\\\\xe5me' is not valid in your current"
61
61
            " filesystem encoding UTF-8$")
62
62
 
63
 
    def test_duplicate_file_id(self):
64
 
        error = errors.DuplicateFileId('a_file_id', 'foo')
65
 
        self.assertEqualDiff('File id {a_file_id} already exists in inventory'
66
 
                             ' as foo', str(error))
67
 
 
68
63
    def test_duplicate_help_prefix(self):
69
64
        error = errors.DuplicateHelpPrefix('foo')
70
65
        self.assertEqualDiff('The prefix foo is in the help search path twice.',
118
113
        self.assertEqual("Invalid range access in path at 12: bad range",
119
114
                         str(error))
120
115
 
121
 
    def test_inventory_modified(self):
122
 
        error = errors.InventoryModified("a tree to be repred")
123
 
        self.assertEqualDiff("The current inventory for the tree 'a tree to "
124
 
                             "be repred' has been modified, so a clean inventory cannot be "
125
 
                             "read without data loss.",
126
 
                             str(error))
127
 
 
128
116
    def test_jail_break(self):
129
117
        error = errors.JailBreak("some url")
130
118
        self.assertEqualDiff("An attempt to access a url outside the server"
192
180
                             "the currently open request.",
193
181
                             str(error))
194
182
 
195
 
    def test_unavailable_representation(self):
196
 
        error = errors.UnavailableRepresentation(
197
 
            ('key',), "mpdiff", "fulltext")
198
 
        self.assertEqualDiff("The encoding 'mpdiff' is not available for key "
199
 
                             "('key',) which is encoded as 'fulltext'.",
200
 
                             str(error))
201
 
 
202
183
    def test_unstackable_location(self):
203
184
        error = errors.UnstackableLocationError('foo', 'bar')
204
185
        self.assertEqualDiff("The branch 'foo' cannot be stacked on 'bar'.",
524
505
            str(e),
525
506
            r'Cannot bind address "example\.com:22":.*Permission denied')
526
507
 
527
 
    def test_transform_rename_failed(self):
528
 
        e = errors.TransformRenameFailed(u"from", u"to", "readonly file", 2)
529
 
        self.assertEqual(
530
 
            u"Failed to rename from to to: readonly file",
531
 
            str(e))
532
 
 
533
508
 
534
509
class TestErrorsUsingTransport(tests.TestCaseWithMemoryTransport):
535
510
    """Tests for errors that need to use a branch or repo."""