~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_upgrade.py

[merge] bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
import os
24
24
import sys
25
25
 
26
 
from bzrlib.selftest import TestCase, TestCaseInTempDir
 
26
from bzrlib.tests import TestCase, TestCaseInTempDir
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.selftest.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)
45
 
        upgrade('.')
46
 
        b = Branch.open('.')
 
43
        self.build_tree_contents(_upgrade1_template)
 
44
        upgrade(u'.')
 
45
        b = Branch.open(u'.')
47
46
        eq(b._branch_format, 6)
48
47
        rh = b.revision_history()
49
48
        eq(rh,
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)
70
 
        upgrade('.')
71
 
        b = Branch.open('.')
 
68
        self.build_tree_contents(_ghost_template)
 
69
        upgrade(u'.')
 
70
        b = Branch.open(u'.')
72
71
        revision_id = b.revision_history()[1]
73
72
        rev = b.get_revision(revision_id)
74
73
        eq(len(rev.parent_ids), 2)
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