/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_http.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-09-12 15:39:32 UTC
  • mfrom: (2000.2.3 jam-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20060912153932-5ad746328277317a
(vila) Fix bug #59835: avoid e.code for URLErrors

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
# TODO: Should be renamed to bzrlib.transport.http.tests?
21
21
 
 
22
import socket
 
23
 
22
24
import bzrlib
23
25
from bzrlib.errors import DependencyNotPresent
24
26
from bzrlib.tests import TestCase, TestSkipped
135
137
        TestCaseWithWebserver.setUp(self)
136
138
        self._prep_tree()
137
139
 
 
140
    def test_has_on_bogus_host(self):
 
141
        import urllib2
 
142
        # Get a random address, so that we can be sure there is no
 
143
        # http handler there.
 
144
        s = socket.socket()
 
145
        s.bind(('localhost', 0))
 
146
        t = self._transport('http://%s:%s/' % s.getsockname())
 
147
        self.assertRaises(urllib2.URLError, t.has, 'foo/bar')
138
148
 
139
149
 
140
150
class TestHttpConnections_pycurl(TestCaseWithWebserver, TestHttpMixins):