~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/test_parent.py

  • Committer: Martin Pool
  • Date: 2005-09-22 13:32:02 UTC
  • Revision ID: mbp@sourcefrog.net-20050922133202-347cfd35d2941dd5
- simple weave-based annotate code (not complete)

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.initialize('.')
 
29
        b = Branch('.', init=True)
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.initialize('.')
 
35
        b = Branch('.', init=True)
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.initialize('from')
 
45
        branch_from = Branch('from', init=True)
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.open('to')
 
53
        branch_to = Branch('to')
54
54
        abspath = os.path.abspath('from')
55
55
        self.assertEquals(branch_to.get_parent(), abspath)
56
56