~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_parent.py

  • Committer: Martin Pool
  • Date: 2006-01-30 06:23:50 UTC
  • mfrom: (1534.1.17 integration)
  • Revision ID: mbp@sourcefrog.net-20060130062350-d6f25277ddcdfd79
[merge] robert's integration of much recent work

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
22
21
from bzrlib.osutils import abspath, realpath
23
22
 
24
23
 
26
25
 
27
26
 
28
27
class TestParent(TestCaseInTempDir):
 
28
 
29
29
    def test_no_default_parent(self):
30
30
        """Branches should have no parent by default"""
31
31
        b = Branch.initialize(u'.')
32
32
        self.assertEquals(b.get_parent(), None)
33
33
        
34
 
    
35
34
    def test_set_get_parent(self):
36
35
        """Set and then re-get the parent"""
37
36
        b = Branch.initialize(u'.')
50
49
        branch_from.working_tree().commit('initial commit')
51
50
        
52
51
        os.mkdir('to')
53
 
        copy_branch(branch_from, 'to', None)
 
52
        branch_from.clone('to', None)
54
53
 
55
54
        branch_to = Branch.open('to')
56
55
        self.assertEquals(branch_to.get_parent(), branch_from.base)