~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/test_parent.py

  • Committer: Robert Collins
  • Date: 2005-09-28 05:37:53 UTC
  • mfrom: (1092.3.4)
  • mto: This revision was merged to the branch mainline in revision 1397.
  • Revision ID: robertc@robertcollins.net-20050928053753-68e6e4c0642eccea
merge from symlink branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
class TestParent(TestCaseInTempDir):
25
25
    def test_no_default_parent(self):
26
26
        """Branches should have no parent by default"""
27
 
        b = Branch('.', init=True)
 
27
        b = Branch.initialize('.')
28
28
        self.assertEquals(b.get_parent(), None)
29
29
        
30
30
    
31
31
    def test_set_get_parent(self):
32
32
        """Set and then re-get the parent"""
33
 
        b = Branch('.', init=True)
 
33
        b = Branch.initialize('.')
34
34
        url = 'http://bazaar-ng.org/bzr/bzr.dev'
35
35
        b.set_parent(url)
36
36
        self.assertEquals(b.get_parent(), url)
40
40
        from bzrlib.commands import run_bzr
41
41
 
42
42
        os.mkdir('from')
43
 
        branch_from = Branch('from', init=True)
 
43
        branch_from = Branch.initialize('from')
44
44
        file('from/foo', 'wt').write('contents of foo')
45
45
        branch_from.add('foo')
46
46
        branch_from.commit('initial commit')
48
48
        os.mkdir('to')
49
49
        copy_branch(branch_from, 'to', None)
50
50
 
51
 
        branch_to = Branch('to')
 
51
        branch_to = Branch.open('to')
52
52
        abspath = os.path.abspath('from')
53
53
        self.assertEquals(branch_to.get_parent(), abspath)
54
54