-import StringIO
import requests
from jenkinsapi.exceptions import JenkinsAPIException
headers, dict), 'headers must be a dict, got %s' % repr(headers)
requestKwargs['headers'] = headers
- if not data==None:
+ if not data == None:
# It may seem odd, but some Jenkins operations require posting
# an empty string.
requestKwargs['data'] = data
return self.post_and_confirm_status(url, params, data, headers)
def post_and_confirm_status(self, url, params=None, data=None, headers=None):
- assert isinstance(data, (str,dict)), "Unexpected data type: %s" % repr(data)
+ assert isinstance(data, (
+ str, dict)), "Unexpected data type: %s" % repr(data)
if not headers:
headers = {'Content-Type': 'application/x-www-form-urlencoded'}
response.url, data, headers, response.status_code, response.text.encode('UTF-8')))
return response
-
def get_and_confirm_status(self, url, params=None, headers=None):
response = self.get_url(url, params, headers)
if not response.status_code == self.STATUS_OK: