/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/test_inv.py

(broken) merge aaron's workingtree format changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
from bzrlib.branch import Branch
23
23
from bzrlib.diff import internal_diff
24
24
from bzrlib.inventory import (Inventory, ROOT_ID, InventoryFile,
25
 
    InventoryDirectory, InventoryEntry)
 
25
    InventoryDirectory, InventoryEntry, TreeReference)
26
26
from bzrlib.osutils import (has_symlinks, rename, pathjoin, is_inside_any, 
27
27
    is_inside_or_parent_of_any)
28
28
from bzrlib.tests import TestCase, TestCaseWithTransport
190
190
        ie = inv.add_path('foo.txt', 'file')
191
191
        ## XXX
192
192
 
 
193
    def test_add_recursive(self):
 
194
        parent = InventoryDirectory('src-id', 'src', ROOT_ID)
 
195
        child = InventoryFile('hello-id', 'hello.c', 'src-id')
 
196
        parent.children[child.file_id] = child
 
197
        inv = Inventory()
 
198
        inv.add(parent)
 
199
        self.assertEqual('src/hello.c', inv.id2path('hello-id'))
 
200
 
193
201
 
194
202
class TestInventoryEntry(TestCase):
195
203
 
623
631
        inv.root = None
624
632
        self.assertFalse(inv.is_root('TREE_ROOT'))
625
633
        self.assertFalse(inv.is_root('booga'))
 
634
 
 
635
 
 
636
class TestTreeReference(TestCase):
 
637
    
 
638
    def test_create(self):
 
639
        inv = Inventory('tree-root-123')
 
640
        inv.add(TreeReference('nested-id', 'nested', parent_id='tree-root-123',
 
641
                              revision='rev', reference_revision='rev2'))