~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_errors.py

  • Committer: John Arbash Meinel
  • Date: 2007-02-26 22:08:14 UTC
  • mto: (2255.11.3 dirstate)
  • mto: This revision was merged to the branch mainline in revision 2322.
  • Revision ID: john@arbash-meinel.com-20070226220814-i6a95mlsdsv3yrf8
Make sure adding a duplicate file_id raises DuplicateFileId.
This adds an explicit test for it, updates Inventory to raise the right error,
and updates Dirstate.add() to also check for a duplicated file_id.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
class TestErrors(TestCaseWithTransport):
32
32
 
 
33
    def test_duplicate_file_id(self):
 
34
        error = errors.DuplicateFileId('a_file_id', 'foo')
 
35
        self.assertEqualDiff('File id {a_file_id} already exists in inventory'
 
36
                             ' as foo', str(error))
 
37
 
33
38
    def test_inventory_modified(self):
34
39
        error = errors.InventoryModified("a tree to be repred")
35
40
        self.assertEqualDiff("The current inventory for the tree 'a tree to "