~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testbranch.py

  • Committer: Robert Collins
  • Date: 2005-10-17 23:13:00 UTC
  • mto: This revision was merged to the branch mainline in revision 1462.
  • Revision ID: robertc@robertcollins.net-20051017231300-e1c9e931bcfacd6a
Branch.open_containing now returns a tuple (Branch, relative-path).

This allows direct access to the common case of 'get me this file
from its branch'. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
167
167
        self.assertRaises(NotBranchError, Branch.open_containing,
168
168
                          self.get_remote_url('g/p/q'))
169
169
        b = Branch.initialize('.')
170
 
        Branch.open_containing(self.get_remote_url(''))
171
 
        Branch.open_containing(self.get_remote_url('g/p/q'))
 
170
        branch, relpath = Branch.open_containing(self.get_remote_url(''))
 
171
        self.assertEqual('', relpath)
 
172
        branch, relpath = Branch.open_containing(self.get_remote_url('g/p/q'))
 
173
        self.assertEqual('g/p/q', relpath)
172
174
        
173
175
# TODO: rewrite this as a regular unittest, without relying on the displayed output        
174
176
#         >>> from bzrlib.commit import commit