~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testbranch.py

  • Committer: Aaron Bentley
  • Date: 2005-10-08 06:41:21 UTC
  • mto: (1185.25.1)
  • mto: This revision was merged to the branch mainline in revision 1425.
  • Revision ID: aaron.bentley@utoronto.ca-20051008064121-364ef62ae059cf5c
Fixed error handling when NotBranch on HTTP

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
from bzrlib.clone import copy_branch
20
20
from bzrlib.commit import commit
21
21
import bzrlib.errors as errors
22
 
from bzrlib.errors import NoSuchRevision, UnlistableBranch
 
22
from bzrlib.errors import NoSuchRevision, UnlistableBranch, NotBranchError
23
23
from bzrlib.selftest import TestCaseInTempDir
24
24
from bzrlib.trace import mutter
25
25
import bzrlib.transactions as transactions
26
 
 
 
26
from bzrlib.selftest.HTTPTestUtil import TestCaseWithWebserver
27
27
 
28
28
class TestBranch(TestCaseInTempDir):
29
29
 
141
141
        # list should be cleared when we do a commit
142
142
        self.assertEquals(b.pending_merges(), [])
143
143
 
144
 
 
 
144
class TestRemote(TestCaseWithWebserver):
 
145
    def test_open_containing(self):
 
146
        self.assertRaises(NotBranchError, Branch.open_containing,
 
147
                          self.get_remote_url(''))
 
148
        self.assertRaises(NotBranchError, Branch.open_containing,
 
149
                          self.get_remote_url('g/p/q'))
 
150
        b = Branch.initialize('.')
 
151
        Branch.open_containing(self.get_remote_url(''))
 
152
        Branch.open_containing(self.get_remote_url('g/p/q'))
 
153
        
145
154
# TODO: rewrite this as a regular unittest, without relying on the displayed output        
146
155
#         >>> from bzrlib.commit import commit
147
156
#         >>> bzrlib.trace.silent = True