Rev 3103: Rename bzrlib/test/HTTPTestUtils.py to bzrlib/tests/http_utils.py and fix in file:///v/home/vila/src/bzr/bugs/175524/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Tue Dec 11 14:26:23 GMT 2007
At file:///v/home/vila/src/bzr/bugs/175524/
------------------------------------------------------------
revno: 3103
revision-id:v.ladeuil+lp at free.fr-20071211142618-pt6ca80047kok237
parent: pqm at pqm.ubuntu.com-20071211072935-5kj4hhh82rgkqqwb
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: 175524
timestamp: Tue 2007-12-11 15:26:18 +0100
message:
Rename bzrlib/test/HTTPTestUtils.py to bzrlib/tests/http_utils.py and fix
uses. Rename bzrlib/test/HttpServer.py to bzrlib/tests/http_server.py
and fix uses. Don't pretend we support HTTP/0.9 since we don't and do
that correctly.
* bzrlib/transport/http/_urllib2_wrappers.py:
(AbstractHTTPConnection): Specifying strict here is useless.
(HTTPConnection, HTTPSConnection): We don't support HTTP/0.9 in
other parts of the stack, be explicit *correctly*.
renamed:
bzrlib/tests/HTTPTestUtil.py => bzrlib/tests/http_utils.py HTTPTestUtil.py-20050914180604-247d3aafb7a43343
bzrlib/tests/HttpServer.py => bzrlib/tests/http_server.py httpserver.py-20061012142527-m1yxdj1xazsf8d7s-1
modified:
bzrlib/tests/__init__.py selftest.py-20050531073622-8d0e3c8845c97a64
bzrlib/tests/blackbox/test_ignore.py test_ignore.py-20060703063225-4tm8dc2pa7wwg2t3-1
bzrlib/tests/blackbox/test_too_much.py blackbox.py-20050620052131-a7370d756399f615
bzrlib/tests/branch_implementations/test_branch.py testbranch.py-20050711070244-121d632bc37d7253
bzrlib/tests/branch_implementations/test_http.py test_http.py-20060731224648-2eef7ae5yja95rya-1
bzrlib/tests/test_bzrdir.py test_bzrdir.py-20060131065654-deba40eef51cf220
bzrlib/tests/test_fetch.py testfetch.py-20050825090644-f73e07e7dfb1765a
bzrlib/tests/test_http.py testhttp.py-20051018020158-b2eef6e867c514d9
bzrlib/tests/test_selftest.py test_selftest.py-20051202044319-c110a115d8c0456a
bzrlib/tests/test_sftp_transport.py testsftp.py-20051027032739-247570325fec7e7e
bzrlib/tests/test_smart_transport.py test_ssh_transport.py-20060608202016-c25gvf1ob7ypbus6-2
bzrlib/tests/test_transport.py testtransport.py-20050718175618-e5cdb99f4555ddce
bzrlib/tests/test_versionedfile.py test_versionedfile.py-20060222045249-db45c9ed14a1c2e5
bzrlib/transport/http/_pycurl.py pycurlhttp.py-20060110060940-4e2a705911af77a6
bzrlib/transport/http/_urllib.py _urlgrabber.py-20060113083826-0bbf7d992fbf090c
bzrlib/transport/http/_urllib2_wrappers.py _urllib2_wrappers.py-20060913231729-ha9ugi48ktx481ao-1
bzrlib/tests/http_utils.py HTTPTestUtil.py-20050914180604-247d3aafb7a43343
-------------- next part --------------
=== renamed file 'bzrlib/tests/HTTPTestUtil.py' => 'bzrlib/tests/http_utils.py'
--- a/bzrlib/tests/HTTPTestUtil.py 2007-11-29 23:22:01 +0000
+++ b/bzrlib/tests/http_utils.py 2007-12-11 14:26:18 +0000
@@ -27,7 +27,7 @@
from bzrlib.smart import protocol
from bzrlib.tests import TestCaseWithTransport
-from bzrlib.tests.HttpServer import (
+from bzrlib.tests.http_server import (
HttpServer,
TestingHTTPRequestHandler,
)
=== renamed file 'bzrlib/tests/HttpServer.py' => 'bzrlib/tests/http_server.py'
=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py 2007-12-06 12:03:35 +0000
+++ b/bzrlib/tests/__init__.py 2007-12-11 14:26:18 +0000
@@ -90,7 +90,7 @@
from bzrlib.transport.readonly import ReadonlyServer
from bzrlib.trace import mutter, note
from bzrlib.tests import TestUtil
-from bzrlib.tests.HttpServer import HttpServer
+from bzrlib.tests.http_server import HttpServer
from bzrlib.tests.TestUtil import (
TestSuite,
TestLoader,
=== modified file 'bzrlib/tests/blackbox/test_ignore.py'
--- a/bzrlib/tests/blackbox/test_ignore.py 2007-11-01 09:52:45 +0000
+++ b/bzrlib/tests/blackbox/test_ignore.py 2007-12-11 14:26:18 +0000
@@ -34,7 +34,6 @@
pathjoin,
terminal_width,
)
-from bzrlib.tests.HTTPTestUtil import TestCaseWithWebserver
from bzrlib.tests.test_sftp_transport import TestCaseWithSFTPServer
from bzrlib.tests.blackbox import ExternalBase
from bzrlib.workingtree import WorkingTree
=== modified file 'bzrlib/tests/blackbox/test_too_much.py'
--- a/bzrlib/tests/blackbox/test_too_much.py 2007-09-18 08:14:00 +0000
+++ b/bzrlib/tests/blackbox/test_too_much.py 2007-12-11 14:26:18 +0000
@@ -49,7 +49,7 @@
pathjoin,
terminal_width,
)
-from bzrlib.tests.HTTPTestUtil import TestCaseWithWebserver
+from bzrlib.tests.http_utils import TestCaseWithWebserver
from bzrlib.tests.test_sftp_transport import TestCaseWithSFTPServer
from bzrlib.tests.blackbox import ExternalBase
from bzrlib.workingtree import WorkingTree
=== modified file 'bzrlib/tests/branch_implementations/test_branch.py'
--- a/bzrlib/tests/branch_implementations/test_branch.py 2007-12-10 19:20:41 +0000
+++ b/bzrlib/tests/branch_implementations/test_branch.py 2007-12-11 14:26:18 +0000
@@ -42,7 +42,7 @@
import bzrlib.revision
from bzrlib.tests import TestCase, TestCaseWithTransport, TestSkipped
from bzrlib.tests.branch_implementations import TestCaseWithBranch
-from bzrlib.tests.HttpServer import HttpServer
+from bzrlib.tests.http_server import HttpServer
from bzrlib.trace import mutter
from bzrlib.transport import get_transport
from bzrlib.transport.memory import MemoryServer
=== modified file 'bzrlib/tests/branch_implementations/test_http.py'
--- a/bzrlib/tests/branch_implementations/test_http.py 2007-03-28 07:48:37 +0000
+++ b/bzrlib/tests/branch_implementations/test_http.py 2007-12-11 14:26:18 +0000
@@ -20,7 +20,7 @@
from bzrlib import branch, errors
from bzrlib.tests.branch_implementations.test_branch import TestCaseWithBranch
-from bzrlib.tests.HttpServer import HttpServer
+from bzrlib.tests.http_server import HttpServer
from bzrlib.transport.local import LocalURLServer
from bzrlib.transport.chroot import TestingChrootServer
=== modified file 'bzrlib/tests/test_bzrdir.py'
--- a/bzrlib/tests/test_bzrdir.py 2007-11-29 07:12:42 +0000
+++ b/bzrlib/tests/test_bzrdir.py 2007-12-11 14:26:18 +0000
@@ -48,8 +48,8 @@
TestSkipped,
test_sftp_transport
)
-from bzrlib.tests.HttpServer import HttpServer
-from bzrlib.tests.HTTPTestUtil import (
+from bzrlib.tests.http_server import HttpServer
+from bzrlib.tests.http_utils import (
TestCaseWithTwoWebservers,
HTTPServerRedirecting,
)
=== modified file 'bzrlib/tests/test_fetch.py'
--- a/bzrlib/tests/test_fetch.py 2007-11-21 23:35:32 +0000
+++ b/bzrlib/tests/test_fetch.py 2007-12-11 14:26:18 +0000
@@ -32,7 +32,7 @@
zero_ninetyone,
)
from bzrlib.tests import TestCaseWithTransport
-from bzrlib.tests.HTTPTestUtil import TestCaseWithWebserver
+from bzrlib.tests.http_utils import TestCaseWithWebserver
from bzrlib.tests.test_revision import make_branches
from bzrlib.trace import mutter
from bzrlib.upgrade import Convert
=== modified file 'bzrlib/tests/test_http.py'
--- a/bzrlib/tests/test_http.py 2007-12-08 23:15:18 +0000
+++ b/bzrlib/tests/test_http.py 2007-12-11 14:26:18 +0000
@@ -36,12 +36,18 @@
ui,
urlutils,
)
-from bzrlib.tests.HttpServer import (
+from bzrlib.tests import (
+ TestCase,
+ TestUIFactory,
+ TestSkipped,
+ StringIOWrapper,
+ )
+from bzrlib.tests.http_server import (
HttpServer,
HttpServer_PyCurl,
HttpServer_urllib,
)
-from bzrlib.tests.HTTPTestUtil import (
+from bzrlib.tests.http_utils import (
BadProtocolRequestHandler,
BadStatusRequestHandler,
ForbiddenRequestHandler,
=== modified file 'bzrlib/tests/test_selftest.py'
--- a/bzrlib/tests/test_selftest.py 2007-10-26 08:12:56 +0000
+++ b/bzrlib/tests/test_selftest.py 2007-12-11 14:26:18 +0000
@@ -647,7 +647,7 @@
self.assertEqual(t2.base[:-1], t.abspath('foo/bar'))
def test_get_readonly_url_http(self):
- from bzrlib.tests.HttpServer import HttpServer
+ from bzrlib.tests.http_server import HttpServer
from bzrlib.transport import get_transport
from bzrlib.transport.local import LocalURLServer
from bzrlib.transport.http import HttpTransportBase
=== modified file 'bzrlib/tests/test_sftp_transport.py'
--- a/bzrlib/tests/test_sftp_transport.py 2007-09-24 09:40:01 +0000
+++ b/bzrlib/tests/test_sftp_transport.py 2007-12-11 14:26:18 +0000
@@ -41,7 +41,7 @@
TestCase,
TestSkipped,
)
-from bzrlib.tests.HttpServer import HttpServer
+from bzrlib.tests.http_server import HttpServer
from bzrlib.transport import get_transport
import bzrlib.transport.http
=== modified file 'bzrlib/tests/test_smart_transport.py'
--- a/bzrlib/tests/test_smart_transport.py 2007-11-09 20:49:54 +0000
+++ b/bzrlib/tests/test_smart_transport.py 2007-12-11 14:26:18 +0000
@@ -39,7 +39,7 @@
server,
vfs,
)
-from bzrlib.tests.HTTPTestUtil import (
+from bzrlib.tests.http_utils import (
HTTPServerWithSmarts,
SmartRequestHandler,
)
=== modified file 'bzrlib/tests/test_transport.py'
--- a/bzrlib/tests/test_transport.py 2007-12-10 10:41:24 +0000
+++ b/bzrlib/tests/test_transport.py 2007-12-11 14:26:18 +0000
@@ -433,9 +433,9 @@
self.assertEqual(True, transport.is_readonly())
def test_http_parameters(self):
- from bzrlib.tests.HttpServer import HttpServer
+ from bzrlib.tests.http_server import HttpServer
import bzrlib.transport.readonly as readonly
- # connect to . via http which is not listable
+ # connect to '.' via http which is not listable
server = HttpServer()
server.setUp()
try:
@@ -466,8 +466,8 @@
def test_http_parameters(self):
# the listable and is_readonly parameters
# are not changed by the fakenfs decorator
- from bzrlib.tests.HttpServer import HttpServer
- # connect to . via http which is not listable
+ from bzrlib.tests.http_server import HttpServer
+ # connect to '.' via http which is not listable
server = HttpServer()
server.setUp()
try:
=== modified file 'bzrlib/tests/test_versionedfile.py'
--- a/bzrlib/tests/test_versionedfile.py 2007-12-03 21:38:07 +0000
+++ b/bzrlib/tests/test_versionedfile.py 2007-12-11 14:26:18 +0000
@@ -40,7 +40,7 @@
KnitPlainFactory,
)
from bzrlib.tests import TestCaseWithMemoryTransport, TestSkipped
-from bzrlib.tests.HTTPTestUtil import TestCaseWithWebserver
+from bzrlib.tests.http_utils import TestCaseWithWebserver
from bzrlib.trace import mutter
from bzrlib.transport import get_transport
from bzrlib.transport.memory import MemoryTransport
=== modified file 'bzrlib/transport/http/_pycurl.py'
--- a/bzrlib/transport/http/_pycurl.py 2007-12-08 23:15:18 +0000
+++ b/bzrlib/transport/http/_pycurl.py 2007-12-11 14:26:18 +0000
@@ -341,6 +341,6 @@
def get_test_permutations():
"""Return the permutations to be used in testing."""
- from bzrlib.tests.HttpServer import HttpServer_PyCurl
+ from bzrlib.tests.http_server import HttpServer_PyCurl
return [(PyCurlTransport, HttpServer_PyCurl),
]
=== modified file 'bzrlib/transport/http/_urllib.py'
--- a/bzrlib/transport/http/_urllib.py 2007-12-03 08:33:06 +0000
+++ b/bzrlib/transport/http/_urllib.py 2007-12-11 14:26:18 +0000
@@ -179,6 +179,6 @@
def get_test_permutations():
"""Return the permutations to be used in testing."""
- from bzrlib.tests.HttpServer import HttpServer_urllib
+ from bzrlib.tests.http_server import HttpServer_urllib
return [(HttpTransport_urllib, HttpServer_urllib),
]
=== modified file 'bzrlib/transport/http/_urllib2_wrappers.py'
--- a/bzrlib/transport/http/_urllib2_wrappers.py 2007-12-06 22:46:16 +0000
+++ b/bzrlib/transport/http/_urllib2_wrappers.py 2007-12-11 14:26:18 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2006,2007 Canonical Ltd
+# Copyright (C) 2006, 2007 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -143,7 +143,6 @@
"""A custom HTTP(S) Connection, which can reset itself on a bad response"""
response_class = Response
- strict = 1 # We don't support HTTP/0.9
def __init__(self):
self._response = None
@@ -181,9 +180,10 @@
class HTTPConnection(AbstractHTTPConnection, httplib.HTTPConnection):
# XXX: Needs refactoring at the caller level.
- def __init__(self, host, port=None, strict=None, proxied_host=None):
+ def __init__(self, host, port=None, proxied_host=None):
AbstractHTTPConnection.__init__(self)
- httplib.HTTPConnection.__init__(self, host, port, strict)
+ # Use strict=True since we don't support HTTP/0.9
+ httplib.HTTPConnection.__init__(self, host, port, strict=True)
self.proxied_host = proxied_host
def connect(self):
@@ -192,13 +192,15 @@
httplib.HTTPConnection.connect(self)
+# FIXME: Should test for ssl availability
class HTTPSConnection(AbstractHTTPConnection, httplib.HTTPSConnection):
def __init__(self, host, port=None, key_file=None, cert_file=None,
- strict=None, proxied_host=None):
+ proxied_host=None):
AbstractHTTPConnection.__init__(self)
+ # Use strict=True since we don't support HTTP/0.9
httplib.HTTPSConnection.__init__(self, host, port,
- key_file, cert_file, strict)
+ key_file, cert_file, strict=True)
self.proxied_host = proxied_host
def connect(self):
@@ -565,7 +567,7 @@
# - with and without certificate
# - with self-signed certificate
# - with and without authentication
- # - with good and bad credentials (especially the proxy auth aound
+ # - with good and bad credentials (especially the proxy auth around
# CONNECT)
# - with basic and digest schemes
# - reconnection on errors
More information about the bazaar-commits
mailing list