Changeset 1450
- Timestamp:
- 11/27/06 14:21:28
- Files:
-
- trunk/cherrypy/test/test.py (modified) (1 diff)
- trunk/cherrypy/test/test_states.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/test/test.py
r1403 r1450 13 13 import getopt 14 14 import httplib 15 import os , os.path15 import os 16 16 localDir = os.path.dirname(__file__) 17 17 serverpem = os.path.join(os.getcwd(), localDir, 'test.pem') trunk/cherrypy/test/test_states.py
r1449 r1450 1 import httplib 1 2 import os 2 3 import sys … … 294 295 295 296 296 def run_all(host, port ):297 def run_all(host, port, ssl=False): 297 298 conf = {'server.socket_host': host, 298 299 'server.socket_port': port, … … 300 301 'environment': "test_suite", 301 302 } 303 304 if ssl: 305 localDir = os.path.dirname(__file__) 306 serverpem = os.path.join(os.getcwd(), localDir, 'test.pem') 307 conf['server.ssl_certificate'] = serverpem 308 conf['server.ssl_private_key'] = serverpem 309 ServerStateTests.scheme == "https" 310 ServerStateTests.HTTP_CONN = httplib.HTTPSConnection 311 302 312 def _run(server): 303 313 print … … 325 335 host = '127.0.0.1' 326 336 port = 8000 337 ssl = False 327 338 if len(sys.argv) > 1: 328 339 cmd = sys.argv[1] … … 330 341 for prefix in ("", "-", "--", "\\")]: 331 342 print 332 print "test_states.py -? -> this help page" 333 print "test_states.py [host] [port] -> run the tests on the given host/port" 334 print "test_states.py -localhosts [port] -> try various localhost strings" 343 print "test_states.py -? -> this help page" 344 print "test_states.py [host] [port] -> run the tests on the given host/port" 345 print "test_states.py -ssl [port] -> run the tests using SSL on %s:port" % host 346 print "test_states.py -localhosts [port] -> try various localhost strings" 335 347 sys.exit(0) 336 348 if len(sys.argv) > 2: … … 339 351 run_localhosts(port) 340 352 sys.exit(0) 341 host = sys.argv[1].strip("\"'") 342 run_all(host, port) 353 if cmd == "-ssl": 354 ssl = True 355 else: 356 host = cmd.strip("\"'") 357 run_all(host, port, ssl)

