/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: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-06-11 12:46:45 UTC
  • mfrom: (7511.1.1 actions-no-fork)
  • Revision ID: breezy.the.bot@gmail.com-20200611124645-4lx66gps99i0hmzh
Avoid using fork when running the testsuite in github actions.

Merged from https://code.launchpad.net/~jelmer/brz/actions-no-fork/+merge/385565

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
 
63
68
    def test_duplicate_help_prefix(self):
64
69
        error = errors.DuplicateHelpPrefix('foo')
65
70
        self.assertEqualDiff('The prefix foo is in the help search path twice.',
113
118
        self.assertEqual("Invalid range access in path at 12: bad range",
114
119
                         str(error))
115
120
 
 
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
 
116
128
    def test_jail_break(self):
117
129
        error = errors.JailBreak("some url")
118
130
        self.assertEqualDiff("An attempt to access a url outside the server"
180
192
                             "the currently open request.",
181
193
                             str(error))
182
194
 
 
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
 
183
202
    def test_unstackable_location(self):
184
203
        error = errors.UnstackableLocationError('foo', 'bar')
185
204
        self.assertEqualDiff("The branch 'foo' cannot be stacked on 'bar'.",
505
524
            str(e),
506
525
            r'Cannot bind address "example\.com:22":.*Permission denied')
507
526
 
 
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
 
508
533
 
509
534
class TestErrorsUsingTransport(tests.TestCaseWithMemoryTransport):
510
535
    """Tests for errors that need to use a branch or repo."""