~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_http.py

  • Committer: Martin Pool
  • Date: 2006-03-09 08:01:51 UTC
  • mto: This revision was merged to the branch mainline in revision 1611.
  • Revision ID: mbp@sourcefrog.net-20060309080151-ad1d845b9aeae633
Add new protocol 'http+pycurl' that always uses PyCurl.

A special http server is provided for testing that asks clients to connect
this way.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Copyright (C) 2005, 2006 Canonical
2
 
 
 
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
5
5
# the Free Software Foundation; either version 2 of the License, or
6
6
# (at your option) any later version.
7
 
 
 
7
#
8
8
# This program is distributed in the hope that it will be useful,
9
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
11
# GNU General Public License for more details.
12
 
 
 
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20
20
# TODO: Should be renamed to bzrlib.transport.http.tests?
21
21
 
22
22
import bzrlib
 
23
import bzrlib.errors as errors
23
24
from bzrlib.tests import TestCase
24
25
from bzrlib.transport import Transport
25
26
from bzrlib.transport.http import extract_auth
76
77
        eq(t.abspath('.bzr/tree-version'),
77
78
           'http://bzr.ozlabs.org/.bzr/tree-version')
78
79
 
 
80
    def test_http_impl_urls(self):
 
81
        """There are servers which ask for particular clients to connect"""
 
82
        try:
 
83
            from bzrlib.transport.http._pycurl import HttpServer_PyCurl
 
84
            server = HttpServer_PyCurl()
 
85
            try:
 
86
                server.setUp()
 
87
                url = server.get_url()
 
88
                self.assertTrue(url.startswith('http+pycurl://'))
 
89
            finally:
 
90
                server.tearDown()
 
91
        except errors.DependencyNotPresent:
 
92
            raise TestSkipped('pycurl not present')
79
93
 
80
94
class TestHttpConnections(TestCaseWithWebserver):
81
95