Changeset 51682

Show
Ignore:
Timestamp:
04/26/07 17:58:24 (3 years ago)
Author:
bdelbosc
Message:

fixing #1837 post() is sent as GET when no params defined

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • funkload/trunk/CHANGES.txt

    r51681 r51682  
    2828 
    2929* fix: # 1834_: multiple redirects not handled properly (jehiah patch). 
     30 
     31* fix: # 1837_: post() is sent as GET when no params defined. 
    3032 
    3133 
     
    492494.. _1284: http://svn.nuxeo.org/trac/pub/ticket/1284 
    493495.. _1300: http://svn.nuxeo.org/trac/pub/ticket/1300 
     496.. _1834: http://svn.nuxeo.org/trac/pub/ticket/1834 
     497.. _1837: http://svn.nuxeo.org/trac/pub/ticket/1837 
    494498.. _Plone: http://plone.org/ 
    495499 
  • funkload/trunk/funkload/FunkLoadTestCase.py

    r51681 r51682  
    167167    def _connect(self, url, params, ok_codes, rtype, description): 
    168168        """Handle fetching, logging, errors and history.""" 
     169        if params is None and rtype == 'post': 
     170            # enable empty post 
     171            params = [] 
    169172        t_start = time.time() 
    170173        try: 
     
    246249        if method == 'get' and params: 
    247250            url = url_in + '?' + urlencode(params) 
     251        else: 
     252            url = url_in 
     253        if method == 'get': 
    248254            params = None 
    249         else: 
    250             url = url_in 
    251255 
    252256        if method == 'get': 
  • funkload/trunk/funkload/PatchWebunit.py

    r51277 r51682  
    247247 
    248248    params = None 
    249     if postdata
     249    if postdata is not None
    250250        if webproxy: 
    251251            h.putrequest('POST', "http://%s%s" % (host_header, url)) 
     
    254254            h.putrequest('POST', url) 
    255255        is_multipart = False 
    256         for field, value in postdata: 
    257             if isinstance(value, Upload): 
    258                 # Post with a data file requires multipart mimeencode 
    259                 is_multipart = True 
     256        if postdata: 
     257            for field, value in postdata: 
     258                if isinstance(value, Upload): 
     259                    # Post with a data file requires multipart mimeencode 
     260                    is_multipart = True 
    260261        if is_multipart: 
    261262            params = mimeEncode(postdata)