~lifeless/bzr/5158

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_errors.py

  • Committer: Robert Collins
  • Date: 2008-08-05 09:43:41 UTC
  • Revision ID: robertc@robertcollins.net-20080805094341-uelcr4qz98trh2yj
Implement the oft-discussed automatic-add-and-delete at commit time.

Show diffs side-by-side

added added

removed removed

Lines of Context:
116
116
        error = errors.InstallFailed([None])
117
117
        self.assertEqual("Could not install revisions:\nNone", str(error))
118
118
 
119
 
    def test_lock_active(self):
120
 
        error = errors.LockActive("lock description")
121
 
        self.assertEqualDiff("The lock for 'lock description' is in use and "
122
 
            "cannot be broken.",
123
 
            str(error))
124
 
 
125
119
    def test_knit_data_stream_incompatible(self):
126
120
        error = errors.KnitDataStreamIncompatible(
127
121
            'stream format', 'target format')
147
141
                         " known method in options: ['bad', 'no-eol']",
148
142
                         str(error))
149
143
 
 
144
    def test_lock_active(self):
 
145
        error = errors.LockActive("lock description")
 
146
        self.assertEqualDiff("The lock for 'lock description' is in use and "
 
147
            "cannot be broken.",
 
148
            str(error))
 
149
 
150
150
    def test_medium_not_connected(self):
151
151
        error = errors.MediumNotConnected("a medium")
152
152
        self.assertEqualDiff(
153
153
            "The medium 'a medium' is not connected.", str(error))
154
154
 
 
155
    def test_missing_files_commit_failure(self):
 
156
        error = errors.MissingFilesCommitFailed(["Foo", "Bar"])
 
157
        self.assertEqualDiff(
 
158
            "Some files were missing but have not been removed by 'bzr rm'. "
 
159
            "You can supply -a to the commit, remove them with 'bzr rm', tell "
 
160
            "bzr they have been renamed with 'bzr mv', or restore them if they "
 
161
            "were accidentally deleted via 'bzr revert'. The files were: "
 
162
            "['Foo', 'Bar'].", str(error))
 
163
 
155
164
    def test_no_public_branch(self):
156
165
        b = self.make_branch('.')
157
166
        error = errors.NoPublicBranch(b)