~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_parent.py

Added unit tests for find_unmerged

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