~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 09:35:50 UTC
  • mfrom: (1185.1.47)
  • Revision ID: robertc@robertcollins.net-20050928093550-3ca194dfaffc79f1
merge from integration

Show diffs side-by-side

added added

removed removed

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