~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_parent.py

MergeĀ fromĀ jam-integration

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
 
18
18
import os
 
19
from bzrlib.branch import Branch
19
20
from bzrlib.tests import TestCaseInTempDir
20
 
from bzrlib.branch import Branch
21
 
from bzrlib.clone import copy_branch
 
21
from bzrlib.osutils import abspath, realpath
22
22
 
23
23
 
24
24
"""Tests for Branch parent URL"""
25
25
 
26
26
 
27
27
class TestParent(TestCaseInTempDir):
 
28
 
28
29
    def test_no_default_parent(self):
29
30
        """Branches should have no parent by default"""
30
31
        b = Branch.initialize(u'.')
31
32
        self.assertEquals(b.get_parent(), None)
32
33
        
33
 
    
34
34
    def test_set_get_parent(self):
35
35
        """Set and then re-get the parent"""
36
36
        b = Branch.initialize(u'.')
49
49
        branch_from.working_tree().commit('initial commit')
50
50
        
51
51
        os.mkdir('to')
52
 
        copy_branch(branch_from, 'to', None)
 
52
        branch_from.clone('to', None)
53
53
 
54
54
        branch_to = Branch.open('to')
55
 
        abspath = os.path.abspath('from')
56
 
        self.assertEquals(branch_to.get_parent(), abspath)
57
 
        
58
 
 
 
55
        self.assertEquals(branch_to.get_parent(), branch_from.base)