Mercurial > public > mercurial-scm > hg
comparison mercurial/httpclient/tests/test_ssl.py @ 16643:24dbef11f477
httpclient: update to revision 892730fe7f46 of httpplus
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Fri, 04 May 2012 16:00:33 -0500 |
parents | a75e0f4ba0ab |
children |
comparison
equal
deleted
inserted
replaced
16642:5cf18921bb7b | 16643:24dbef11f477 |
---|---|
26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 import unittest | 29 import unittest |
30 | 30 |
31 import http | 31 import httpplus |
32 | 32 |
33 # relative import to ease embedding the library | 33 # relative import to ease embedding the library |
34 import util | 34 import util |
35 | 35 |
36 | 36 |
37 | 37 |
38 class HttpSslTest(util.HttpTestBase, unittest.TestCase): | 38 class HttpSslTest(util.HttpTestBase, unittest.TestCase): |
39 def testSslRereadRequired(self): | 39 def testSslRereadRequired(self): |
40 con = http.HTTPConnection('1.2.3.4:443') | 40 con = httpplus.HTTPConnection('1.2.3.4:443') |
41 con._connect() | 41 con._connect() |
42 # extend the list instead of assign because of how | 42 # extend the list instead of assign because of how |
43 # MockSSLSocket works. | 43 # MockSSLSocket works. |
44 con.sock.data = ['HTTP/1.1 200 OK\r\n', | 44 con.sock.data = ['HTTP/1.1 200 OK\r\n', |
45 'Server: BogusServer 1.0\r\n', | 45 'Server: BogusServer 1.0\r\n', |
64 resp.headers.getheaders('multiheader')) | 64 resp.headers.getheaders('multiheader')) |
65 self.assertEqual(['BogusServer 1.0'], | 65 self.assertEqual(['BogusServer 1.0'], |
66 resp.headers.getheaders('server')) | 66 resp.headers.getheaders('server')) |
67 | 67 |
68 def testSslRereadInEarlyResponse(self): | 68 def testSslRereadInEarlyResponse(self): |
69 con = http.HTTPConnection('1.2.3.4:443') | 69 con = httpplus.HTTPConnection('1.2.3.4:443') |
70 con._connect() | 70 con._connect() |
71 con.sock.early_data = ['HTTP/1.1 200 OK\r\n', | 71 con.sock.early_data = ['HTTP/1.1 200 OK\r\n', |
72 'Server: BogusServer 1.0\r\n', | 72 'Server: BogusServer 1.0\r\n', |
73 'MultiHeader: Value\r\n' | 73 'MultiHeader: Value\r\n' |
74 'MultiHeader: Other Value\r\n' | 74 'MultiHeader: Other Value\r\n' |