~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/inventory_implementations/basics.py

  • Committer: Vincent Ladeuil
  • Date: 2007-11-04 15:29:17 UTC
  • mfrom: (2961 +trunk)
  • mto: (2961.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 2962.
  • Revision ID: v.ladeuil+lp@free.fr-20071104152917-nrsumxpk3dikso2c
Merge bzr.dev

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
 
 
78
    def test_copy_empty(self):
 
79
        """Make sure an empty inventory can be copied."""
 
80
        inv = self.make_inventory(root_id=None)
 
81
        inv2 = inv.copy()
 
82
        self.assertIs(None, inv2.root)
 
83
 
68
84
    def test_is_root(self):
69
85
        """Ensure our root-checking code is accurate."""
70
86
        inv = self.make_inventory('TREE_ROOT')