Changeset 1884
- Timestamp:
- 01/28/08 23:07:34
- Files:
-
- trunk/cherrypy/test/test_conn.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/test/test_conn.py
r1874 r1884 5 5 6 6 import httplib 7 import urllib 7 8 import socket 8 9 import sys … … 13 14 import cherrypy 14 15 from cherrypy.test import webtest 16 from cherrypy import _cperror 15 17 16 18 … … 66 68 err_before_read.exposed = True 67 69 err_before_read._cp_config = {'hooks.on_start_resource': raise500} 70 71 def one_megabyte_of_a(self): 72 return ["a" * 1024] * 1024 73 one_megabyte_of_a.exposed = True 68 74 69 75 cherrypy.tree.mount(Root()) … … 539 545 ## self.assertNoHeader("Connection") 540 546 547 def test_598(self): 548 remote_data_conn = urllib.urlopen('http://%s:%s/one_megabyte_of_a/' % (self.HOST, self.PORT,)) 549 received_data = remote_data_conn.read(512) 550 time.sleep(6.0) 551 remaining = 1024*1024 - 512 552 received_data = ' ' 553 while remaining and received_data: 554 received_data = remote_data_conn.read(remaining) 555 remaining -= len(received_data) 556 557 self.assertTrue(received_data) 558 self.assertEqual(remaining, 0) 541 559 542 560 if __name__ == "__main__":

