~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_errors.py

  • Committer: Andrew Bennetts
  • Date: 2007-04-10 14:12:35 UTC
  • mto: This revision was merged to the branch mainline in revision 2404.
  • Revision ID: andrew.bennetts@canonical.com-20070410141235-wtmjydzktegq64cz
Use the Command pattern for handling smart server commands.

This improves readability and testability.

This change has been extracted from the hpss branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
class TestErrors(TestCaseWithTransport):
32
32
 
 
33
    def test_disabled_method(self):
 
34
        error = errors.DisabledMethod("class name")
 
35
        self.assertEqualDiff(
 
36
            "The smart server method 'class name' is disabled.", str(error))
 
37
 
33
38
    def test_duplicate_file_id(self):
34
39
        error = errors.DuplicateFileId('a_file_id', 'foo')
35
40
        self.assertEqualDiff('File id {a_file_id} already exists in inventory'