/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 bzrlib/tests/inventory_implementations/basics.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-10-24 17:19:20 UTC
  • mfrom: (2935.2.1 bzr.dev)
  • Revision ID: pqm@pqm.ubuntu.com-20071024171920-7ow21d7v5crrxdc4
Fix Inventory.copy() and add a test for it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
        self.assertEqual('hello-id', ie.file_id)
66
66
        self.assertEqual('file', ie.kind)
67
67
 
 
68
    def test_copy(self):
 
69
        """Make sure copy() works and creates a deep copy."""
 
70
        inv = self.make_inventory(root_id='some-tree-root')
 
71
        ie = inv.add_path('hello', 'file', 'hello-id')
 
72
        inv2 = inv.copy()
 
73
        inv.root.file_id = 'some-new-root'
 
74
        ie.name = 'file2'
 
75
        self.assertEqual('some-tree-root', inv2.root.file_id)
 
76
        self.assertEqual('hello', inv2['hello-id'].name)
 
77
 
68
78
    def test_is_root(self):
69
79
        """Ensure our root-checking code is accurate."""
70
80
        inv = self.make_inventory('TREE_ROOT')