~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_parent.py

Merge from integration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
 
18
18
import os
19
 
from bzrlib.selftest import TestCaseInTempDir
 
19
from bzrlib.tests import TestCaseInTempDir
20
20
from bzrlib.branch import Branch
21
21
from bzrlib.clone import copy_branch
 
22
from bzrlib.osutils import abspath, realpath
22
23
 
23
24
 
24
25
"""Tests for Branch parent URL"""
27
28
class TestParent(TestCaseInTempDir):
28
29
    def test_no_default_parent(self):
29
30
        """Branches should have no parent by default"""
30
 
        b = Branch.initialize('.')
 
31
        b = Branch.initialize(u'.')
31
32
        self.assertEquals(b.get_parent(), None)
32
33
        
33
34
    
34
35
    def test_set_get_parent(self):
35
36
        """Set and then re-get the parent"""
36
 
        b = Branch.initialize('.')
 
37
        b = Branch.initialize(u'.')
37
38
        url = 'http://bazaar-ng.org/bzr/bzr.dev'
38
39
        b.set_parent(url)
39
40
        self.assertEquals(b.get_parent(), url)
52
53
        copy_branch(branch_from, 'to', None)
53
54
 
54
55
        branch_to = Branch.open('to')
55
 
        abspath = os.path.abspath('from')
56
 
        self.assertEquals(branch_to.get_parent(), abspath)
 
56
        abs = abspath('from')
 
57
        self.assertEquals(branch_to.get_parent(), abs)
57
58
        
58
59