~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_upgrade.py

[merge] robertc

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
from bzrlib.branch import Branch
28
28
from bzrlib.revision import is_ancestor
29
29
from bzrlib.upgrade import upgrade
30
 
from bzrlib.tests.treeshape import build_tree_contents
31
30
 
32
31
 
33
32
class TestUpgrade(TestCaseInTempDir):
34
33
    
35
34
    def test_build_tree(self):
36
35
        """Test tree-building test helper"""
37
 
        build_tree_contents(_upgrade1_template)
 
36
        self.build_tree_contents(_upgrade1_template)
38
37
        self.failUnlessExists('foo')
39
38
        self.failUnlessExists('.bzr/README')
40
39
 
41
40
    def test_upgrade_simple(self):
42
41
        """Upgrade simple v0.0.4 format to v6"""
43
42
        eq = self.assertEquals
44
 
        build_tree_contents(_upgrade1_template)
 
43
        self.build_tree_contents(_upgrade1_template)
45
44
        upgrade('.')
46
45
        b = Branch.open('.')
47
46
        eq(b._branch_format, 6)
66
65
        systems, where the importer knows about a revision but not 
67
66
        its contents."""
68
67
        eq = self.assertEquals
69
 
        build_tree_contents(_ghost_template)
 
68
        self.build_tree_contents(_ghost_template)
70
69
        upgrade('.')
71
70
        b = Branch.open('.')
72
71
        revision_id = b.revision_history()[1]
75
74
        eq(rev.parent_ids[1], 'wibble@wobble-2')
76
75
 
77
76
    def test_upgrade_makes_dir_weaves(self):
78
 
        build_tree_contents(_upgrade_dir_template)
 
77
        self.build_tree_contents(_upgrade_dir_template)
79
78
        upgrade('.')
80
79
        # this is the path to the literal file. As format changes 
81
80
        # occur it needs to be updated. FIXME: ask the store for the