Changeset 3356

Show
Ignore:
Timestamp:
01/11/10 15:14:51 (10 years ago)
Author:
cemeyer
Message:

#816: Fix up the httpretrieve unit tests.

Location:
seattle/trunk/seattlelib/tests/httpretrieve_test
Files:
4 removed
5 modified

Legend:

Unmodified
Added
Removed
  • seattle/trunk/seattlelib/tests/httpretrieve_test/ut_httpretrieve_content_timeout.py

    r3276 r3356  
    5050  try: 
    5151    # start up http retrieve to retieve the content from http server 
    52     recv_msg = httpretrieve_get_string('http://127.0.0.1:12345/', http_query=None, http_post=None, http_header=None, header_timeout=30, content_timeout=4) 
     52    recv_msg = httpretrieve_get_string('http://127.0.0.1:12345/', timeout=30) 
    5353 
    5454  #catch the right Exception if there is a different exception print failed_error_msg 
  • seattle/trunk/seattlelib/tests/httpretrieve_test/ut_httpretrieve_filelikeobj_closed.py

    r3314 r3356  
    3636 
    3737  #catch the right Exception(HttpUserInputError) if there is a different exception print failed_error_msg 
    38   except HttpUserInputError, e: 
     38  except ValueError, e: 
    3939    # check if the error message is correct     
    40     if 'filelikeobj is closed' not in str(e):  
    41       print failed_error_msg + ' :Raised: ' + str(e)  
     40    pass 
    4241  except Exception, e: 
    4342    print failed_error_msg + ' :Raised: ' + str(e)   
  • seattle/trunk/seattlelib/tests/httpretrieve_test/ut_httpretrieve_header_timeout.py

    r3314 r3356  
    3131  failed_error_msg = 'Failed: HttpContentReceivingError should have raised a timeout exception' 
    3232  try: 
    33     recv_msg = httpretrieve_get_string('http://127.0.0.1:12345', http_query=None, http_post=None, http_header=None, header_timeout=5)   
     33    recv_msg = httpretrieve_get_string('http://127.0.0.1:12345', timeout=5)   
    3434 
    3535  # catch the right Exception(HttpHeaderReceivingError) if there is a different exception print failed_error_msg 
    36   except HttpHeaderReceivingError, e: 
     36  except SocketTimeoutError, e: 
    3737    # check if the error message is correct     
    3838    if 'Timeout Error on receiving header' not in str(e):  
  • seattle/trunk/seattlelib/tests/httpretrieve_test/ut_httpretrieve_post.py

    r3331 r3356  
    3333  try: 
    3434    # use httpretrieve to retrieve the content form the server.(which is the posted data)   
    35     recv_msg = httpretrieve_get_string('http://127.0.0.1:12345', None, http_post)    
     35    recv_msg = httpretrieve_get_string('http://127.0.0.1:12345', postdata=http_post)    
    3636 
    3737  except Exception, e: 
  • seattle/trunk/seattlelib/tests/httpretrieve_test/ut_httpretrieve_redirect_notgiven.py

    r3056 r3356  
    3636def httpresponse(sock): 
    3737  # sends response to http retrieve with a content length longer than the http header content length   
    38   httpheader = 'HTTP/1.1 301 Moved Permanently\n\n' 
     38  httpheader = 'HTTP/1.1 301 Moved Permanently\r\n\r\n' 
    3939  # normal server should include the http redirect location over here  
    4040 
     
    5959 
    6060  #catch the right Exception if there is a different exception print failed_error_msg 
    61   except HttpHeaderFormatError, e: 
    62     # check if the error message is correct     
    63     if 'http redirect header didnt include the location' not in str(e):  
    64       print failed_error_msg + ' :Raised: ' + str(e) 
     61  except HttpBrokenServerError, e: 
    6562    pass   
    6663  except Exception, e: