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