[Python-checkins] r54678 - python/trunk/Lib/test/test_socket_ssl.py (original) (raw)

facundo.batista python-checkins at python.org
Tue Apr 3 23:15:37 CEST 2007


Author: facundo.batista Date: Tue Apr 3 23:15:34 2007 New Revision: 54678

Modified: python/trunk/Lib/test/test_socket_ssl.py Log:

Changed the whole structure of startup and checking if the server is available. Hope to not get more false alarms.

Modified: python/trunk/Lib/test/test_socket_ssl.py

--- python/trunk/Lib/test/test_socket_ssl.py (original) +++ python/trunk/Lib/test/test_socket_ssl.py Tue Apr 3 23:15:34 2007 @@ -110,32 +110,24 @@ class OpenSSLTests(unittest.TestCase): def testBasic(self): - time.sleep(.2) s = socket.socket() s.connect(("localhost", 4433)) ss = socket.ssl(s) ss.write("Foo\n") i = ss.read(4) self.assertEqual(i, "Foo\n") + s.close() -def haveOpenSSL(): - try: - s = subprocess.Popen("openssl rand 1".split(), stdout=subprocess.PIPE) - s.stdout.read(1) - except OSError, err: - if err.errno == 2: - return False - raise - return True

class OpenSSLServer(threading.Thread): def init(self): self.s = None self.keepServing = True

@@ -149,10 +141,27 @@ else: raise ValueError("No cert file found!")

@@ -181,22 +190,23 @@ # in these platforms we can kill the openssl process if sys.platform in ("sunos5", "darwin", "linux1", "linux2", "win32", "hp-ux11"):

if name == "main": test_main()



More information about the Python-checkins mailing list