1
from bzrlib.tests import TestCaseInTempDir
2
from bzrlib.branch import Branch
3
from bzrlib.transform import TreeTransform
5
class TestTreeTransform(TestCaseInTempDir):
7
branch = Branch.initialize('.')
8
wt = branch.working_tree()
9
transform = TreeTransform(wt)
11
root = transform.get_id_tree(wt.get_root_id())
12
trans_id = transform.create_path('name', transform.root)
13
transform.create_file('contents', trans_id)
14
transform.version_file('my_pretties', trans_id)
16
self.assertEqual('contents', file('name').read())
17
self.assertEqual(wt.path2id('name'), 'my_pretties')
20
# is it safe to finalize repeatedly?