Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1884

Show
Ignore:
Timestamp:
01/28/08 23:07:34
Author:
lakin
Message:

Adding a test to expose the bug described in #598. When I run test_conn.py in python2.4 the test fails in OSX, when I run the test in python2.5 in osx the test passes.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/test/test_conn.py

    r1874 r1884  
    55 
    66import httplib 
     7import urllib 
    78import socket 
    89import sys 
     
    1314import cherrypy 
    1415from cherrypy.test import webtest 
     16from cherrypy import _cperror 
    1517 
    1618 
     
    6668        err_before_read.exposed = True 
    6769        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 
    6874     
    6975    cherrypy.tree.mount(Root()) 
     
    539545##        self.assertNoHeader("Connection") 
    540546 
     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)  
    541559 
    542560if __name__ == "__main__": 

Hosted by WebFaction

Log in as guest/cpguest to create tickets