view Lib/test/test_socket_ssl.py @ 25838:8540887bcec6 2.2

Backport of 2.183: Fix memory leak in add_subclass() found by NealN with valgrind.
author Guido van Rossum <guido@python.org>
date Fri, 18 Oct 2002 13:42:21 +0000
parents a12ccdbce8da
children aa0d2d51fbde
line wrap: on
line source

# Test just the SSL support in the socket module, in a moderately bogus way.

import test_support

# Optionally test SSL support.  This currently requires the 'network' resource
# as given on the regrtest command line.  If not available, nothing after this
# line will be executed.
test_support.requires('network')

import socket
if not hasattr(socket, "ssl"):
    raise test_support.TestSkipped("socket module has no ssl support")

import urllib

socket.RAND_status()
try:
    socket.RAND_egd(1)
except TypeError:
    pass
else:
    print "didn't raise TypeError"
socket.RAND_add("this is a random string", 75.0)

f = urllib.urlopen('https://sf.net')
buf = f.read()
f.close()