~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-27 07:24:40 UTC
  • mfrom: (1185.1.41)
  • Revision ID: robertc@robertcollins.net-20050927072440-1bf4d99c3e1db5b3
pair programming worx... merge integration and weave

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
 
18
18
import os
19
 
from bzrlib.tests import TestCaseInTempDir
20
 
from bzrlib.branch import Branch
21
 
from bzrlib.clone import copy_branch
 
19
from bzrlib.selftest import TestCaseInTempDir
 
20
from bzrlib.branch import Branch, copy_branch
22
21
 
23
22
 
24
23
"""Tests for Branch parent URL"""
27
26
class TestParent(TestCaseInTempDir):
28
27
    def test_no_default_parent(self):
29
28
        """Branches should have no parent by default"""
30
 
        b = Branch.initialize(u'.')
 
29
        b = Branch.initialize('.')
31
30
        self.assertEquals(b.get_parent(), None)
32
31
        
33
32
    
34
33
    def test_set_get_parent(self):
35
34
        """Set and then re-get the parent"""
36
 
        b = Branch.initialize(u'.')
 
35
        b = Branch.initialize('.')
37
36
        url = 'http://bazaar-ng.org/bzr/bzr.dev'
38
37
        b.set_parent(url)
39
38
        self.assertEquals(b.get_parent(), url)
45
44
        os.mkdir('from')
46
45
        branch_from = Branch.initialize('from')
47
46
        file('from/foo', 'wt').write('contents of foo')
48
 
        branch_from.working_tree().add('foo')
49
 
        branch_from.working_tree().commit('initial commit')
 
47
        branch_from.add('foo')
 
48
        branch_from.commit('initial commit')
50
49
        
51
50
        os.mkdir('to')
52
51
        copy_branch(branch_from, 'to', None)