Changeset 3365

Show
Ignore:
Timestamp:
01/13/10 23:10:41 (10 years ago)
Author:
yemuru
Message:

update tests

Location:
seattle/trunk/seattlelib/tests/registerhttpcallback_tests
Files:
1 added
3 modified

Legend:

Unmodified
Added
Removed
  • seattle/trunk/seattlelib/tests/registerhttpcallback_tests/ut_registerhttpcallback_exception.py

    r3313 r3365  
    1212 
    1313def test_callbackfunc_error(httprequest_dictionary, http_query, http_post): 
    14   # server that raises an exception     
    15   raise HttpError404('The file no longer exists') 
     14  # server sends a 404 error to the client     
     15  return['The file no longer exists', None, 404] 
    1616    
    1717 
  • seattle/trunk/seattlelib/tests/registerhttpcallback_tests/ut_registerhttpcallback_query_post.py

    r3330 r3365  
    4040  except Exception, e: 
    4141    raise Exception('http retrieve failed on retrieving data from server')   
    42   else: 
    43     if mycontext['received_http_query'] != http_query: 
    44       print 'query failed' 
    45       print 'sent query dict was ' + str(http_query) 
    46       print 'received query dict was ' + str(mycontext['received_http_query']) 
    4742 
    48     if mycontext['received_http_post'] != http_post: 
    49       print 'post failed' 
    50       print 'sent query dict was ' + str(http_query) 
    51       print 'received query dict was ' + str(mycontext['received_http_post'])     
    52        
    5343  finally: 
    54     #stop sever 
     44    # stop the servers 
    5545    stop_registerhttpcallback(handle) 
     46     
     47  if mycontext['received_http_query'] != http_query: 
     48    print 'query failed' 
     49    print 'sent query dict was ' + str(http_query) 
     50    print 'received query dict was ' + str(mycontext['received_http_query']) 
     51 
     52  if mycontext['received_http_post'] != http_post: 
     53    print 'post failed' 
     54    print 'sent query dict was ' + str(http_query) 
     55    print 'received query dict was ' + str(mycontext['received_http_post'])     
     56     
     57 
  • seattle/trunk/seattlelib/tests/registerhttpcallback_tests/ut_registerhttpcallback_redirect.py

    r3313 r3365  
    1212def test_redirect(httprequest_dictionary, http_query, http_post): 
    1313  # server that redirects to a different server(http://127.0.0.2:12345)    
    14   raise HttpError302('http://127.0.0.2:12345') 
     14  return ['redirecting too http://127.0.0.2:12345', {'Location': 'http://127.0.0.2:12345'}, 301] 
     15 
    1516 
    1617def test_redirected(httprequest_dictionary, http_query, http_post):