80
82
InventoryDirectory('123', 'src', parent_id='TREE_ROOT', revision=None)
81
83
>>> i.add(InventoryFile('2323', 'hello.c', parent_id='123'))
82
84
InventoryFile('2323', 'hello.c', parent_id='123', sha1=None, len=None)
85
>>> shouldbe = {0: '', 1: 'src', 2: pathjoin('src','hello.c')}
84
86
>>> for ix, j in enumerate(i.iter_entries()):
85
87
... print (j[0] == shouldbe[ix], j[1])
89
(True, InventoryDirectory('TREE_ROOT', '', parent_id=None, revision=None))
87
90
(True, InventoryDirectory('123', 'src', parent_id='TREE_ROOT', revision=None))
88
91
(True, InventoryFile('2323', 'hello.c', parent_id='123', sha1=None, len=None))
89
92
>>> i.add(InventoryFile('2323', 'bye.c', '123'))